How do I reset an increment identity's starting value in SQL Server
问题 I would like to have a nice template for doing this in development. How do I reset an increment identity's starting value in SQL Server? 回答1: DBCC CHECKIDENT('TableName', RESEED, 0) 回答2: Just a word of warning with: DBCC CHECKIDENT (MyTable, RESEED, 0) If you did not truncate the table, and the identity column is the PK, you will get an error when reaching pre-existing identites. For example, you have identities (3,4,5) in the table already. You then reset the identity column to 1. After the