Reputation: 742
Using SQL Server, I've got a column "ID" in my table that auto-increments every time I insert a new record.
How can I reset this counter and return to 1?
Upvotes: 2
Views: 65
Reputation: 7219
If you are SQL Server, and assuming your ID column uses the IDENTITY() property, you need to use the DBCC CHECKIDENT syntax:
USE MyDatabase
GO
DBCC CHECKIDENT ('myschema.MyTable', RESEED, 1);
GO
Upvotes: 1