There are a couple of ways of doing it:
- If you are emptying the table, instead of using a DELETE, use a TRUNCATE. That will automatically reset the identity.
- The ID can be set to a specific number by using DBCC CHECKIDENT([TABLE_NAME], RESEED, n). Where n is the number that is to be set.
DBCC CHECKIDENT([TABLE_NAME], RESEED, 0) DBCC CHECKIDENT([TABLE_NAME], RESEED)
No comments:
Post a Comment