ThanksCheck out DBCC CHECKIDENT. This will do what you need.
FromSQL Server 2000 Books Online:
C. Force the current identity value to 30
This example forces the current identity value in the jobs table to a value of 30.
USE pubs
GO
DBCC CHECKIDENT (jobs, RESEED, 30)
GO
Terri|||I believe that if you issue a TRUNCATE TABLE command on the table, the identity seed will be reset to its original value.
Overall, a better strategy, since TRUNCATE TABLE is much faster than the corresponding delete statement...|||how do I do this?|||From within SQL Query Analyzer:
TRUNCATE TABLE tablename
GO
Be careful. This will delete all of the records in your table, swiftly and immediately, upon hitting that magic F5 key (or upon hitting the run arrow).|||mmmm truncate table... :) I've scared many of people with that.
Best thing to do is put that thing in a transaction just in case.
No comments:
Post a Comment