Identity Columns

Identity Columns

Post by Erin Peterso » Wed, 03 Mar 2004 00:44:12



Hi all.

Is it possible to alter a numeric column to make it an IDENTITY column?

SQL Server 2K

TIA,
Erin

 
 
 

Identity Columns

Post by Itzik Ben-Ga » Wed, 03 Mar 2004 00:47:50


No way to alter the column to add/remove the identity property.
You can add a new column with the property, or, if you need to keep the
original values:

* Create a new table, with an identity property for the desired column
* Turn on IDENTITY_INSERT
* Copy the data
* Drop old table
* Rename new table
* Create all constraints/indexes/triggers

--
BG, SQL Server MVP
www.SolidQualityLearning.com


Quote:> Hi all.

> Is it possible to alter a numeric column to make it an IDENTITY column?

> SQL Server 2K

> TIA,
> Erin


 
 
 

Identity Columns

Post by Vishal Parka » Wed, 03 Mar 2004 00:49:49


make use of Enterprise manager to do this. there is no "alter table" command to change this
property.

--
Vishal Parkar