BUG: Create Table with Double Precision May Be Inconsistent (169072)
The information in this article applies to:
- Microsoft SQL Server 6.0
- Microsoft SQL Server 6.5
This article was previously published under Q169072 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.
Modification Type: | Major | Last Reviewed: | 10/16/2003 |
---|
Keywords: | kbBug kbusage KB169072 |
---|
|