BUG: Create Table with Double Precision May Be Inconsistent

ID: Q169072


The information in this article applies to:
  • Microsoft SQL Server versions 6.0, 6.5


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.

Additional query words:

Keywords : kbusage SSrvTran_SQL kbbug6.50 kbbug6.00
Version : winnt:6.0,6.5
Platform : winnt
Issue type : kbbug


Last Reviewed: December 14, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.