The DBCC CHECKIDENT
management command is used to reset the identity counter. The command syntax is:
DBCC CHECKIDENT (table_name [, { NORESEED | { RESEED [, new_reseed_value ]}}])
[ WITH NO_INFOMSGS ]
Example:
DBCC CHECKIDENT ('[TestTable]', RESEED, 0);
IMPORTANT: The following example forces the current identity value in the AddressTypeID
column in the AddressType
table to a value of 10. Because the table has existing rows, the next row inserted will use 11 as the value. The new current identity value is defined for the column plus 1 (which is the column’s increment value).
USE AdventureWorks2022; GO DBCC CHECKIDENT ('Person.AddressType', RESEED, 10); GO