Reseed identity columns?
ssobolev
Posts: 5
I currently have database update procedure implemented using SQL Compare/Data Compare API.
General algorithm is like this:
1. Create new database from script folder using SQL Compare API
2. Fill it with base set of data
3. Compare database structure for new database and existing one;
4. Apply additions to existing database
5. Compare data in existing database with new one using SQL Data Compare API
6. Apply any additions/significant changes to existing database from new one
7. drop temporary database
This process does reset identity seeds on existing database. Is there any way to reseed them properly, whitout using "DBCC CHECKIDENT"?
General algorithm is like this:
1. Create new database from script folder using SQL Compare API
2. Fill it with base set of data
3. Compare database structure for new database and existing one;
4. Apply additions to existing database
5. Compare data in existing database with new one using SQL Data Compare API
6. Apply any additions/significant changes to existing database from new one
7. drop temporary database
This process does reset identity seeds on existing database. Is there any way to reseed them properly, whitout using "DBCC CHECKIDENT"?
Comments
It is the same with v6 and v7, if I put in Reseed Identity Column option, it reseeds this column not to the CORRECT value, but to zero.
Here is an example of generated code:
-- Reseed identity on [dbo].[Customers]
DBCC CHECKIDENT('[dbo].[Customers]', RESEED, 0)
GO
How can I make it to look like
-- Reseed identity on [dbo].[Customers]
DBCC CHECKIDENT('[dbo].[Customers]', RESEED)
GO
without manually processing SQL code? is there an option to force such reseed ?