When working with SQL Server databases, there are times when a table needs to be completely cleared, and its identity values reset back to the starting point.
Depending on the situation, developers may choose to use either TRUNCATE TABLE for faster table clearing or DELETE combined with DBCC CHECKIDENT for greater control over the process.
Both methods are commonly used during development, testing, debugging, and database cleanup operations.
[SQL Server - TRUNCATE]
TRUNCATE TABLE YourTableName
Copy
Search Site
Search Google
[SQL Server - Delete and Reseed]
delete from YourTableName
Copy
Search Site
Search Google

DBCC CHECKIDENT ('[YourTableName]', RESEED, 0);
Copy
Search Site
Search Google