Microsoft KB Archive/308736

= FIX: Incorrect Results Returned When Query Compares Large Precision and Scale Decimal Value with Integer =

Article ID: 308736

Article Last Modified on 10/16/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q308736



BUG #: 354044 (SHILOH_BUGS)



SYMPTOMS
A query may return incorrect results when it compares an integer value with a decimal value that has a precision and scale greater than 28.

For example, the following query demonstrates the problem: USE pubs GO

CREATE TABLE t1 (c INT) GO

INSERT INTO t1 VALUES (10) GO

-- The decimal number has 30 9s SELECT * FROM t1 WHERE c = CONVERT( DECIMAL( 30, 29), 9.99999999999999999999999999999 ) GO The preceding SELECT query should not return a value. However, the query returns a value of 10.



CAUSE
A decimal value with a precision and scale greater than 28 is incorrectly rounded when compared to an integer.



RESOLUTION
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack



STATUS
Microsoft has confirmed that this is a problem in Microsoft SQL Server 2000. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 2.

Keywords: kbbug kbfix KB308736

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.