Một số lệnh về Identity Column ở SQL Server

set identity về 0

DBCC CHECKIDENT('tableName', RESEED, NEW_RESEED_VALUE)

Nếu muốn sét giá trị cho identity thì chạy lệnh 

-- Set Identity insert on so that value can be inserted into this column
SET IDENTITY_INSERT YourTable ON
GO
-- Insert the record which you want to update with new value in identity column
INSERT INTO YourTable(IdentityCol, otherCol) VALUES(13,'myValue')
GO
-- Delete the old row of which you have inserted a copy (above) (make sure about FK's)
DELETE FROM YourTable WHERE ID=3
GO
--Now set the idenetity_insert OFF to back to prevoius track
SET IDENTITY_INSERT YourTable OFF