BUG: Select Into Creates Table w/ Incorrect Precision & Scale

Last reviewed: May 2, 1997
Article ID: Q150717

The information in this article applies to:
  • Microsoft SQL Server, version 6.0
BUG#: 15072 (6.00)

SYMPTOMS

When SELECT INTO is used to create a new permanent table with initial value of 000.0, it creates a table with the length 2, precision 4 and scale 1. It works fine if any value other than 0 is used. This does not happen if you select into from an existing table into a new table.

drop table numtest go select i1=0000.0 into numtest go --** The length will be 2, precision will be 5 and scale 1 ** sp_help numtest go

WORKAROUND

Declare a variable as numeric before doing a SELECT INTO.

declare @var1 numeric(4,1) select @var1 = 0000.0 select var2=@var1 into newtest

STATUS

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

This problem does not occur in Microsoft SQL Server version 6.5.


Additional query words: sql6
Keywords : kbbug6.00 kbprg SSrvProg
Version : 6.0
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: May 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.