Thursday, 21 April 2011

How to Reset Auto Increment ID + SQL Server

USE dbname
GO
DBCC CHECKIDENT (tablename, RESEED, 0)
GO

it will reset to 0 again, but u r col is primary key not continue insert rows because in that col is not support duplicates.


u r column only auto increment then support but duplicates is there.

but u need last all rows is deleted and reset auto increment value assigned exec perfectly.