Monday, 18 May 2009

Change IDENTITY SEED using T-SQL


DBCC CHECKIDENT ({{TABLENAME}}, RESEED, {{NEW SEED}})

Be VERY careful to check the results of this command, it is possible to set the seed lower than the current maximum value of the identity column. If this is not checked and more records are inserted then you can run into serious trouble!

No comments: