Resetting Primary key without deleting truncating table
I have a table with a primary key, now without any reason I don't know when I am inserting data it is being loaded like this Pk_Col Some_Other_Col 1 A 2 B 3 C 1002 D 1003 E 1901 F Is there any way I can reset my table like below, without deleting/ truncating the table? Pk_Col Some_Other_Col 1 A 2 B 3 C 4 D 5 E 6 F You can't update the IDENTITY column so DELETE/INSERT is the only way. You can reseed the IDENTITY column and recreate the data, like this: DBCC CHECKIDENT ('dbo.tbl',RESEED,0); INSERT INTO dbo.tbl (Some_Other_Col) SELECT Some_Other_Col FROM (DELETE FROM tbl OUTPUT deleted.*) d; That