locked
defining max precision for numeric in sql server 2005 RRS feed

  • Question

  • I had defined the precession for numeric data type as (19,6) in SQL server 2005. My client wants no limit on digit after decimals.

    Is there a way to define the precession to max so that the max(possible) no. of digits can be taken afer the decimal.

    Thanks
    madhur_ms
    Monday, September 19, 2011 8:34 AM

Answers

  • Hi,

    In this case, you would define numeric(38,25).

    This will allow the same 13 digits before the decimal point and 25 after, which is the maximum if you need 13 digits before the decimal point, as the overall maximum is 38.

    Hope this helps.

    Pete


    Peter Carter http://sqlserverdownanddirty.blogspot.com/
    Monday, September 19, 2011 8:44 AM

All replies

  • Hi,

    In this case, you would define numeric(38,25).

    This will allow the same 13 digits before the decimal point and 25 after, which is the maximum if you need 13 digits before the decimal point, as the overall maximum is 38.

    Hope this helps.

    Pete


    Peter Carter http://sqlserverdownanddirty.blogspot.com/
    Monday, September 19, 2011 8:44 AM
  • Thanks Peter ... Appreciate your quick response.. It helped..
    madhur_ms
    Monday, September 19, 2011 10:01 AM