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)
 Alter column to add IDENTITY

Author  Topic 

sqlpal2007
Posting Yak Master

200 Posts

Posted - 2008-05-08 : 09:46:04
Hello All,
There is a table A in SQL. One of the column of A was IDENTITY before and was getting referenced in other table B.

During migration to SQL 2005, I removed the IDENTITY constraint and imported all the data from 2000 to 2005. Now I have to deploy the IDENTITY back to the column. I am getting an error while executing the code:

ALTER TABLE TableA
ALTER COLUMN ColumnA
ADD CONSTRAINT IDENTITY(445,1)


Can anyone tell me where I am going wrong? Or if there is any other way to do it. There are 50+ tables I need to do the same.

Thanks,
-S

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2008-05-08 : 10:02:04
Here's an article on this very subject...

http://www.sqlservercentral.com/articles/T-SQL/61979/

Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page
   

- Advertisement -