With SQL Server, you can do so by using the DBCC CHECKIDENT command.
DBCC CHECKIDENT ('MyTable', RESEED, 0)
Now if you want to reset the identity of a table that still contains some rows, you must reseed it to the last number used.
DBCC CHECKIDENT ('MyTable', RESEED, 123)
No comments:
Post a Comment