Difference betweeen DECIMAL and NUMERIC



They are the same for almost all purposes.

At one time different vendors used different names (Numeric/Decimal) for almost the same thing. SQL-92 made them the same with one minor difference which can be vendor specific:

NUMERIC must be exactly as precise as it is defined — so if you define 4 decimal places, the DB must always store 4 decimal places.

DECIMAL must be at least as precise as it is defined. This means that the database can actually store more digits then specified (due to the behind-the-scenes storage having space for extra digits). This means the database might store 1.00005 instead of 1.0000, affecting future calculations.

In SQL Server Numeric is defined as being identical to Decimal in every way — both will always store only the specified number of decimal places.


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章