I need to change the primary key of a table to an identity column, and there\'s already a number of rows in table.
I\'ve got a script to clean up the IDs to ensure
Basically there are four logical steps.
Create a new Identity column. Turn on Insert Identity for this new column.
Insert the data from the source column (the column you wished to convert to Identity) to this new column.
Turn off the Insert Identity for the new column.
Drop your source column & rename the new column to the name of the source column.
There may be some more complexities like working across multiple servers etc.
Please refer the following article for the steps (using ssms & T-sql). These steps are intended for beginners with less grip on T-SQL.
http://social.technet.microsoft.com/wiki/contents/articles/23816.how-to-convert-int-column-to-identity-in-the-ms-sql-server.aspx