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.
DBCC CHECKIDENT (yourtable, reseed, 301)
After executing this command, you will find next inserted id is:302.
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.