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)


There are no comments for this entry.
[Add Comment] [Subscribe to Comments]