DelphiFAQ Home Search:
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.

Featured Article

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.

Generated 12:00:25 on Oct 27, 2020