BUG: Float Data May Cause Data-Conversion Overflow in ISQL/w

Last reviewed: April 29, 1997
Article ID: Q114524

The information in this article applies to:

  - Microsoft SQL Server Programmer's Toolkit, version 4.2
BUG# 9661 (4.2b)

SYMPTOMS

Certain floating point numbers are not correctly displayed by ISQL/w. For example, executing the following TRANSACT SQL statement:

   SELECT 0.0006

Will generate

   --------------------
   *

   (1 row(s) affected)

   DB-Library: Data-conversion resulted in overflow.

This is caused by the inherent loss of precision incurred when representing float data. Certain floating point values will be converted into wide character strings which cannot be displayed by ISQL/w - - 0.0006 but will be converted to the following string 6.000000000000001e-004.

WORKAROUND

Use the TRANSACT SQL STR function when retrieving data of type FLOAT. Unless information that can only be represented as float needs to be stored, use the other available datatypes.

STATUS

Microsoft has confirmed this to be a problem in SQL Server version 4.2b for OS/2. This problem does not occur in version 6.0.


Additional query words: dblib dbroutines dbconvert
Keywords : kbtool SSrvISQL
Version : 4.2 4.2b 4.2.11
Platform : WINDOWS


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 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.