Tuesday, May 22, 2012

How to reset the identity column of any table

Following syntax can be used to check the current identity value of table:

USE DatabaseName;
GO
DBCC CHECKIDENT ("TableName", NORESEED);
GO
 
Following syntax can be used to reset the current identity value of table: 
USE DatabaseName;
GO
DBCC CHECKIDENT ("TableName", RESEED, 10);
GO 

No comments:

Post a Comment