Restart counter of a SQL Server identity field

by Dani Arlandis — on

If we want to delete all records of a table and restart their identity fields we can simply use a query TRUNCATE TABLE. But if it does not suit us, or do not want to delete all or any registration, etc. We need to quickly restart an Identity field to the value we deem appropriate:

This statement will allow us to perform a restart:


DBCC CHECKIDENT (tblname, RESEED, 0)