BUG: Create Table with Double Precision May Be Inconsistent

Last reviewed: May 28, 1997
Article ID: Q169072
The information in this article applies to:
  • Microsoft SQL Server, versions 6.0 and 6.5
BUG #: 16932 (6.50)

SYMPTOMS

Creating a table with double precision for the same data field column but in different order may result in an inconsistent table definition.

The following scripts demonstrate this problem:

   CREATE TABLE floatTable
   (
     GuessWhatCol double precision,
     charCol char
   )
   GO

   SP_HELP floatTable
   GO

   CREATE TABLE realTable
   (
     charCol char,
     GuessWhatCol double precision
   )
   GO

   SP_HELP realTable
   GO

The GuessWhatCol in floatTable becomes float, which is 8 bytes in size, while the same GuessWhatCol in realTable is real, and 4 bytes in length.

WORKAROUND

To work around this problem, you can specify the binary precision for SQL Server 6.5, or decimal precision for SQL Server 6.0. The following sample scripts demonstrate the workaround for both SQL Server 6.0 and 6.5:

   /* Using binary precision in SQL Server 6.50 */
   CREATE TABLE floatTable
   (
     GuessWhatCol double precision(25), /* float datatype */
     charCol char
   )
   GO

   SP_HELP floatTable
   GO

   CREATE TABLE realTable
   (
     charCol char,
     GuessWhatCol double precision(24) /* real datatype */
   )
   GO

   SP_HELP realTable
   GO

   /* Using decimal precision in SQL Server 6.0 */
   CREATE TABLE floatTable
   (
     GuessWhatCol double precision(8), /* float datatype */
     charCol char
   )
   GO

   SP_HELP floatTable
   GO

   CREATE TABLE realTable
   (
     charCol char,
     GuessWhatCol double precision(7) /* real datatype */
   )
   GO

   SP_HELP realTable
   GO

STATUS

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

Keywords          : kbbug6.00 kbbug6.50 SSrvTran_SQL kbusage
Version           : 6.0 6.5
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbworkaround


================================================================================


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