About this site
Links to us
General :: Databases :: MS-SQL
Tricks how to deal with Microsoft SQL Server (MS-SQL).
This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Generated 0:00:28 on Aug 10, 2020
How to reset or reseed the IDENTITY column
How can I reset or reseed the IDENTITY column?
See DBCC CHECKIDENT in SQL Server Books Online.
A quick and dirty way to reset the IDENTITY column would be to run TRUNCATE TABLE command on that table. TRUNCATE TABLE will delete all the rows from the table and reset the IDENTITY column. However, you will not be able to run TRUNCATE TABLE on a table referenced by foreign keys.
|Most recent comments