What are the challenges you face when working across database platforms? Take the survey

Reseed identity columns?

ssobolevssobolev 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"?


  • Options
    Are you using the default SqlOptions enumeration? This includes the option 'Reseed Identity columns'. If you don't want to use this option then you'll have to explicitly call the options that you want to use leaving the option to 'Reseed Identity Columns' out. You can find information about sqloptions from http://help.red-gate.com/help/SQLDataCo ... /index.htm
  • Options
    Haven't had the chance to check it with API v7 till today.
    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)

    How can I make it to look like
    -- Reseed identity on [dbo].[Customers]
    DBCC CHECKIDENT('[dbo].[Customers]', RESEED)
    without manually processing SQL code? is there an option to force such reseed ?
Sign In or Register to comment.