I have a table with 11 rows variable now i am need in id column and set as primary key and i want to number or auto increment the id column for 11 rows
eg :
id name address
null a b
null c d
.
.
11 records
i want ot output like that
id name address
1 a b
2 c d
.
.
.
11 z f
Add auto increment to newly added column which is null with
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Iftikar HussainRank #423 · 5.9K reputationPosted Jul 25, 2013, 10:39 PM EDT
Create a new column with identity & drop the existing column
Regards,
Iftikar
Ravi ShekharRank #673 · 3.6K reputationPosted Jul 25, 2013, 10:36 PM EDT
Means your first column first row value is 1 after that it will increment by 1.
Regards,
Ravi
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 25, 2013, 10:44 PM EDT
Alter table Example add NewColumn int identity(1,1)