Baran Topal

Baran Topal


April 2024
M T W T F S S
« Feb    
1234567
891011121314
15161718192021
22232425262728
2930  

Categories


auto increment value to original in MSSQL

baranbaran

Long ago, I wanted to revert auto increment value to its original value which starts as 1 in MSSQL 2008.

This is possible by either dropping and recreating the column or do a RESEED through DBCC CHECKIDENT.

DBCC CHECKIDENT ("{myTable}", RESEED, 1);

Another way is provided that there are no foreign keys you can also do

TRUNCATE TABLE YourTableName