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
 General SQL Server Forums
 New to SQL Server Programming
 Modify column in table in sql

Author  Topic 

mavericky
Posting Yak Master

117 Posts

Posted - 2011-07-22 : 19:41:22
Hi,
I have a table Customer whose Primary Key is
ID - IDENTITY NOT NULL. I want to change it to ID NOT NULL.
I want it to remain primary key but just make it a non identity column. Is it possible?

Thanks in anticipation,
Mavericky

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2011-07-22 : 22:29:33
No, you can't alter the identity property with ALTER TABLE ALTER COLUMN. You would need to add a new column, update the values from the old column, drop the old column, rename the new column.

Be One with the Optimizer
TG
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-07-23 : 03:54:33
http://www.mssqltips.com/tip.asp?tip=1397

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -