Reset Identity Seed Value – SQL Server 2005

Reset Identity Seed Value – SQL Server 2005

Not really SharePoint related but something that really saved my bacon today!

If you are using an identity column for a number in SQL Server and need to change the current value – e.g.start the next identity seed at 500 rather you can use the following commands:

To check what the current identity value is:

DBCC CHECKIDENT (‘tablename’, NORESEED)

To set the valueof the next ID/Identity value, use this command (where value is the number you want):

DBCC CHECKIDENT (‘tablename’, RESEED, ‘value’)

Hope this helps some people.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">