Baran Topal

Baran Topal


March 2024
M T W T F S S
« Feb    
 123
45678910
11121314151617
18192021222324
25262728293031

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