Reset Identity Key

You cannot use TRUNCATE TABLE on a table that has relational constraints. So if you have an identity key and you want to reset, or insert specific key values, then you will need to use DELETE and the rather idiosyncratic DBCC CHECKIDENT function.

Usage: DBCC CHECKIDENT(<Table Name>, RESEED, <Start Seed Value>

Example:DBCC CHECKIDENT(ToDoLists, RESEED, 0)

Posted in Knowledge Base and tagged .

Leave a Reply

Your email address will not be published. Required fields are marked *