Reset Identity Seed Value – SQL Server 2005

8 01 2009

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.