<t>You can't alter the existing columns for identity.<br/>
<br/>
You have 2 options,<br/>
<br/>
<br/>
Create a new table with identity & drop the existing table<br/>
<br/>
<br/>
Create a new column with identity & drop the existing column<br/>
<br/>
Approach 1. (New table) Here you can retain the existing data values on the newly created identity column. Note that you will lose all data if 'if not exists' is not satisfied, so make sure you put the condition on the drop as well!<br/>
<br/>
CREATE TABLE dbo.Tmp_Names<br/>
(<br/>
Id int NOT NULL<br/>
IDENTITY(1, 1),<br/>
Name varchar(50) NULL<br/>
)<br/>
ON [PRIMARY]<br/>
go<br/>
<br/>
SET IDENTITY_INSERT dbo.Tmp_Names ON<br/>
go<br/>
<br/>
IF EXISTS ( SELECT *<br/>
FROM dbo.Names ) <br/>
INSERT INTO dbo.Tmp_Names ( Id, Name )<br/>
SELECT Id,<br/>
Name<br/>
FROM dbo.Names TABLOCKX<br/>
go<br/>
<br/>
SET IDENTITY_INSERT dbo.Tmp_Names OFF<br/>
go<br/>
<br/>
DROP TABLE dbo.Names<br/>
go<br/>
<br/>
Exec sp_rename 'Tmp_Names', 'Names'<br/>
<br/>
```<br/><br/>
Approach 2 (*New column*) You can’t retain the existing data values on the newly created identity column, The identity column will hold the sequence of number.<br/>
<br/>Alter Table Names<br/>
Add Id_new Int Identity(1, 1)<br/>
Go<br/>
<br/>
Alter Table Names Drop Column ID<br/>
Go<br/>
<br/>
Exec sp_rename 'Names.Id_new', 'ID', 'Column'<br/>
<br/>
```<br/>
<br/>
See the following Microsoft SQL Server Forum post for more details:<br/>
<br/>
How to alter column to identity(1,1)</t>