Article ID: 285544 - View products that this article applies to.
This article was previously published under Q285544
BUG #: 203148 (SHILOH_bugs)
When using decimal or numeric data types, if you divide 0 by a negative number, a negative 0 (-0) is returned.
To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/290211/EN-US/ )INF: How to Obtain the Latest SQL Server 2000 Service Pack
Check for 0 before you perform the division and avoid the division if 0 is involved; for example:
Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.
SQL Server does not consider the computed value (-0) equal to 0, so the comparison of the computed value (-0) with 0 fails. For example, the following code
Gives the following result:
For additional information about related bugs in SQL Server 7.0, click the article number below to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/275608/EN-US/ )FIX: Mathematical Operations on Numeric or Decimal Columns with Negative Numbers May Return Unexpected Results