BUG: Create Table with Double Precision May Be InconsistentLast reviewed: May 28, 1997Article ID: Q169072 |
The information in this article applies to:
SYMPTOMSCreating 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 GOThe GuessWhatCol in floatTable becomes float, which is 8 bytes in size, while the same GuessWhatCol in realTable is real, and 4 bytes in length.
WORKAROUNDTo 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 STATUSMicrosoft 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 |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |