BUG:After ALTER TABLE to Add Identity Col, type_name Incorrect

Last reviewed: May 2, 1997
Article ID: Q142757

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

SYMPTOMS

If you create a table with an int identity field included in the CREATE TABLE statement sp_columns shows type_name correctly as "int identity." However, if you create the table without an identity field and then ALTER TABLE to add an int identity column, sp_columns shows type_name for the identity field as "int" and not "int identity." This can also be viewed from 16-bit ODBC Test using SQLColumns which is equivalent to sp_columns.

STATUS

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

MORE INFORMATION

To reproduce the problem, run the following script:

create table ram1 (x int, y int identity) create table ram2 (x int) go alter table ram2 add y int identity go print "FOR THIS ONE, y CORRECTLY SHOWS UP AS INT IDENTITY->" exec sp_columns ram1 go print ' ' print "FOR THIS ONE, y SHOWS UP AS INT->" exec sp_columns ram2 go


Additional query words: sql6 winnt
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.