SQL Server, Numric,decimal,money three types of field differences

Source: Internet
Author: User

Are exact data types, the first two can define their own lengths and decimal digits, and Money's definition is equivalent to Numric (19,4)

Numeric (10,2)
Indicates that the maximum can be 10 digits, but the 10 digits have 2 digits that are decimals such as:
12345678.12

Numeric
Functionally equivalent to decimal.

The money type of SQL Server is actually a decimal type decimal.

Number of bytes Length (Before the decimal point. After the decimal point)
Money 8 15-bit. 4-bit
Decimal (19,4) 9 15-bit. 4-bit (below Petabyte)
SmallMoney 4 6-bit. 4-bit
Decimal (10,4) 9 6-bit. 4 bits (under million)
Decimal (9,4) 5 5-bit. 4 bits (less than 100,000)

Decimal is the same length and precision as money, but decimal takes up 1 bytes more than Money (5 bytes more than smallmoney), for general and Standard, it is recommended to use decimal directly, sacrificing a bit of hard disk is nothing.

SQL Server, Numric,decimal,money three types of field differences

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.