Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alter Table: Remove Column Identity Property

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
What is the correct syntax for removing the identity property from a column? I don't want to delete the column and then re-create it as a non-identity column, I want to keep the column as it is, with all its contents, just remove the identity property in the table design. I can do this manually in Enterprise manager, but I have to script this change, so I need to know how to do this with an ALTER TABLE statement.

Does anyone know how to do this? Thanks :)
 

I don't believe it is possible with a simple Alter Table statement. When you use Enterprise Manager to remove the Identity property, it actually creates a new table, moves all the data, drops the old table and then renames the new table. It would be simpler to create a new column, insert data from the Identity column, delete the Identity column and rename the new column. In this way you would retain the current values. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top