BUG: Zero May Be Negative, Depending on the Numeric Scale

Last reviewed: April 16, 1997
Article ID: Q165376
The information in this article applies to:
  • Microsoft SQL Server, version 6.5
BUG #: 16672

SYMPTOMS

Depending on numeric scale, a negative sign may be generated for the value of zero.

The following scripts demonstrate the problem:

   declare @i numeric(28,5), @j numeric(28, 5), @k numeric(28,5)
   select @i =  0.0
   select @j = -1.0
   select @k = @i * @j
   select @i, @j, @k

   where @k = 0.00000 versus

   declare @i numeric(28,6), @j numeric(28, 6), @k numeric(28,6)
   select @i =  0.0
   select @j = -1.0
   select @k = @i * @j
   select @i, @j, @k

   where @k = -0.000000

WORKAROUND

To work around this problem, adjust the scale to avoid generating a negative zero. For example, use any scale between 1 and 5 to work around the problem described in the scenario above.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Keywords : kbbug6.50 kbusage SSrvGen
Version : 6.5
Platform : WINDOWS
Issue type : kbbug
Resolution Type : kbpending


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.