Reset AutoIncrement in SqlServer after Delete

Home / SQL Server / Reset AutoIncrement in SqlServer after Delete

Hi,

This is most common issue face everybody in day to day life, to resolve this use following command to reseed mytable to start at 1:

 DBCC CHECKIDENT (mytable, RESEED,1)

Also be careful that you don’t have records higher than the seed you are setting.

For sound proof solution using below link

Using DBCC CHECKIDENT to Reseed a Table After Delete

Happy Coding …

 

edgedoll.com

Comments(0)

Leave a Comment