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