What is the maximum precision with Decimal in SQL server 2005

16,389

Depends how many values you want left of the decimal point, probably 17. So precision should be 17 + 17 = 34, and scale = 17.

So long as your scale is 17 and your precision is >= 17 (whatever your precision - scale is how many digits you can have left of the decimal point).

http://msdn.microsoft.com/en-us/library/ms187746(v=SQL.90).aspx

Share:
16,389
Relativity
Author by

Relativity

A guy with average IQ - still try to explore microsoft .net day by day :)

Updated on June 05, 2022

Comments

  • Relativity
    Relativity almost 2 years

    I need to retain upto 17 decimal places. What is the appropriate precision with Decimal in SQL server 2005 ?

  • Relativity
    Relativity over 13 years
    But When I gave Decimal(20,17)...it shows arithmetic overflow
  • Relativity
    Relativity over 13 years
    Does Decimal(20,17) means ...20 integer before the decimal point and 17 integers after decimal point?
  • markmnl
    markmnl over 13 years
    No it mean 20 digits over all and 17 after leaving 3 before.
  • Relativity
    Relativity over 13 years
    I have a value..Decimal(17,11). when I multiply this value with another decimal...i need to maintain the deimal values
  • Necreaux
    Necreaux over 2 years
    The question specifies SQL Server 2005, but 10+ years later the link for the latest version may prove useful: docs.microsoft.com/en-us/sql/t-sql/data-types/…