SQL Server Performance

Decimal Digit

Discussion in 'General DBA Questions' started by fauzanf, Jun 22, 2009.

  1. fauzanf New Member

    Dear All,
    I have a question about digit on decimal number in Microsoft SQL Server 2000.
    I creating an application. If i input 0.956 from the application, the number store in table is 0.956. This value i saw from Enterprise Manager.
    But, why if i look from Query Analyzer the value is 0.95599997... ? I know the value is still the same with 0.956
    Thanks
    Fauzan
  2. FrankKalis Moderator

    Welcome to the forum!
    Don't trust Enterprise Manager! It's no tool for that purpose. It appears as if your underlying datatype is float and Enterprise Manager is applying some rounding to the value.
    Some decimal values just cannot be represented exactly when using a float datatype. If that is unacceptable to you, you need to switch to a appropriate decimal datatype
  3. fauzanf New Member

    Thanks for replying my post.
    I using Real Data Type.
    Thanks.
  4. FrankKalis Moderator

    The real datatype is just a single precision float datatype. It is also an "approximate" datatype. This explains why you may see different values in Query Analyzer and Enterprise Manager
  5. Madhivanan Moderator

Share This Page