SQL Server: Script to reset Table Identity using DBCC CHECKIDENT

In this post, I provide one important DBCC command to reset or change the current value of Table Identity.
I have found that this is a most popular questions from SQL Server Professional so I am also interested to write a small note on this.

Using DBCC CHECKIDENT, you can reseed the identity value of the table.
For example, Your table has total 268 rows and last id is 268 and now if you want to skip some identity values for the next couple of insertion and require next id value as a 302.

You can use this command to perform this exercise.

After executing this command, you will find next inserted id is:302.

You can find more details on Microsoft Official Page.

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

1 Comment on "SQL Server: Script to reset Table Identity using DBCC CHECKIDENT"

Notify of
Sort by:   newest | oldest | most voted

I like the helpful information you provide in your articles.
I will bookmark your weblog and check again here regularly.

I’m quite certain I will learn many new stuff right here!
Best of luck for the next!