How to reset and Identity seed in SQL Server

Searching today for my own good and use here at Navtrak, I found a simple little SQL Script that reseed's an identity column down to any value you choose.

Now, this will SERIOUSLY mess your application up if you are using the identity column as your ID in a Foreign Key elsewhere. However, in this case where I am generating unique serial numbers it works just fine. We started at 0, and through testing it jumped up to 250. Production wanted to start at 0 and for that reason we used this:


DBCC CHECKIDENT('uniqueSerials', RESEED, 0)

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC was created by Raymond Camden. This blog is running version 5.9.2.002. Contact Blog Owner
back to my home page back to my home page my clients my resume about me navtrak - gps tracking