If an auto incremented index is defined in a table, then when we delete all the data from this table, the new values of the “id” column are incremented from the last inserted value event if it is no longer in the table.
What if we copy a database and there is a requirement to keep the “id” column identical?
Then we use this command:
DBCC CHECKIDENT (tableName, RESEED, newValue)
Tags
SQL Server