Is it possible to set the identity column of a table to start from a specific value?
I'm converting an ETL stage from mysql to a sql server database where a staging database loads records with a unique ID starting from the maximum value in the main database (which is not auto-incrementing). The mysql went like this:
SET @s = Concat('alter table table_1 auto_increment=',coalesce(@indexmaxt,0)+1);
Ideally this is what I want to do:
DBCC CHECKIDENT (table_1 , RESEED, @indexmaxt+1)
Is this possible or is this impossible in SQL server
Best Answer
This works, does that answer your question?
Results: id 10000
value 1