Setting the next ID in MSSQL Table
December 19th, 2006 by Ivan Uzunov
Have you ever been in a situation when you want to set the next value of the identity column? This is s simple task that can be done with DBCC CHECKIDENT statement. This example deleted all records with ID greater than 135 from the table Products. Than it sets the current identity value to 135. Thus when the next record is added it will have ID with value 136.
DELETE FROM [Products] WHERE id>135DBCC CHECKIDENT, identity, MS SQL Server, RESEED
GODBCC CHECKIDENT (Products, RESEED, 135)
GO



