How to change identity value of the table using DBCC CHECKIDENT in SQL Server

Today we got a problem in test server. We have to change the identity of the table.
After that i solve a solution like this.


DBCC CHECKIDENT ('tablename', RESEED, RequiredNumber)

Ex: DBCC CHECKIDENT ('EmpTable', RESEED, 1000)

If EmpTable is having 50 records. After run this query in sql server, next record will be 1001. 

Share this post :

Post a Comment

Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.

 
Support : Ranga Rajesh Kumar
Copyright © 2012. ASP.NET Examples - All Rights Reserved
Site Designed by Ranga Rajesh Kumar