SQL Information

Reset Auto-Increment after delete

After debugging your code and adding a bunch of partial recorts to your table, you may find that you need to now delete the extra records. The downside is that now you may have a really large auto-increment number. You can reset the number with the following command:

DBCC CHECKIDENT (tableName, RESEED, 0);

This will reset the value back to zero. This assumes that you have deleted all records in the table.