Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Dropping identity proprety from column

Author  Topic 

sanjnep
Posting Yak Master

191 Posts

Posted - 2007-06-19 : 14:05:14
I have a table which has Primary key and identity column. I want to drop the identity property of the PK but I didn’t find any alter statement to remove identity property. Do you have any idea how to do this? I am using SQL Server 2005.
Thanks
SS

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-06-19 : 14:11:26
No such alter table statement exists. Make the change in SSMS, click the save change script button, view the code that it uses. That's the same method you would have to use to remove the identity option. The method involves creating a new table with the layout you want, copying your data to this new table, adding indexes and constraints etc... to this new table, dropping the old table, then renaming the new table to the name of the old table.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

ilimax
Posting Yak Master

164 Posts

Posted - 2009-06-08 : 23:05:16
I can not beleive there is no easy way to alter table and remove identity property ...
Go to Top of Page
   

- Advertisement -