Dha*_*ana 122 sql-server sqldatatypes
SQL Server中的DECIMAL和NUMERIC数据类型有什么区别吗?
什么时候应该使用DECIMAL和NUMERIC?
Guf*_*ffa 101
他们是一样的.数字在功能上等同于十进制.
MSDN:十进制和数字
Joa*_*man 40
这就是SQL2003标准(第6.1节数据类型)对这两者的说法:
<exact numeric type> ::=
NUMERIC [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
| DECIMAL [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
| DEC [ <left paren> <precision> [ <comma> <scale> ] <right paren> ]
| SMALLINT
| INTEGER
| INT
| BIGINT
...
21) NUMERIC specifies the data type
exact numeric, with the decimal
precision and scale specified by the
<precision> and <scale>.
22) DECIMAL specifies the data type
exact numeric, with the decimal scale
specified by the <scale> and the
implementation-defined decimal
precision equal to or greater than the
value of the specified <precision>.
Run Code Online (Sandbox Code Playgroud)
kev*_*ers 11
据我所知,NUMERIC和DECIMAL数据类型没有区别.它们是彼此的同义词,任何一个都可以使用.DECIMAL和NUMERIC数据类型是具有固定精度和比例的数字数据类型.
编辑:
对一些同事说,也许它与DECIMAL是ANSI SQL标准有关,而NUMERIC是Mircosoft更喜欢的编程语言中常见的....也许 ;)