May 22, 2009 at 10:06 am
How do I reset the Identity counter for a table?
Thanks
Jim
May 22, 2009 at 10:13 am
User TRUNCATE TABLE
Regards,
Nitin
May 22, 2009 at 10:13 am
Use TRUNCATE TABLE
Regards,
Nitin
May 22, 2009 at 10:23 am
Thanks!!
May 22, 2009 at 10:31 am
what do you mean by reseed?
Truncate is going to remove all your data!
What about DBCC CHECKIDENT (tableName,reseed, ?)
----------------------------------------------
Try to learn something about everything and everything about something. - Thomas Henry Huxley
:w00t:
Posting Best Practices[/url]
Numbers / Tally Tables[/url]
May 22, 2009 at 10:34 am
truncate will remove all data AND reset the identity to it's starting value, whatever that was. It doesn't have to be 1.
DBCC RESEED will reset it to the value you specify, which can be anything.
depending on what you want to do, choose the appropriate one. Note that identities are not necessarily unique.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply