DBCC CHECKIDENT
checks or resets the identity counter
What changes
- Input
- identity column current value and max column value
- Output or change
- identity seed (RESEED) or a message
Syntax at a glance
DBCC CHECKIDENT ( table_name [ , { NORESEED | { RESEED [ , new_reseed_value ] } } ] ) [ WITH NO_INFOMSGS ]
Work example
An incident review needs to compare a table's identity state with its stored keys.
Inspect the current maximum key and identity state before considering any reseed operation.
Check your work The next generated value will not collide with a stored key.
Open Microsoft Learn for full syntax, permissions, and details for your version.