SQL Data Compare attempting to set IDENTITY columns to NULL

kevin_bktkevin_bkt Posts: 3
I am using SQL Data Compare We use the tool regularly to save changes to data made by individual developers, and then apply those changes to other environments. Our databases are SQL Server 2005/2008.

Now I'm trying to generate a database from scratch from source control, instead of applying incremental changes. The target database is empty, and there are about 24000 differences to be applied. When I deploy, I get the error "DEFAULT or NULL are not allowed as explicit identity values".

Looking at the deployment script, I can see that SQL Data Compare is trying to set the value of identity columns in several (but not all) tables to NULL. In the .sql data files in source control, the INSERT statements do not store any value for the identity columns (as I think it should be). Yet these NULLs are generated at deployment time. I've tried using the re-seed identity columns option, but this makes no difference.

I would appreciate anyone who could point me in the right direction on this. Right now, I'm looking at having to edit a very large number of changes in the deployment script to get this database created.




  • Hi Kevin - is there any reason you're still using SQL Data Compare 10.2? We've released a few updates to the tool since then - the most recent version is

    If you could update to that version and let me know if you're still seeing this issue that'd be great - you can update from within the tool by going to Help->Check for Updates.
    Andy Campbell Smith

    Red Gate Technical Support Engineer
  • 11 days is a bit long for a response, don't you think? I've long since had to come up with another way to perform the task I was attempting.

    Next chance I have, I will try what you suggest, but don't know when that will be.
  • Yes, sorry - I'm afraid this got lost in our system. Usually we attempt to respond within 8 business hours for supported customers - I'm really sorry it took us so long to get back to you this time. If you do want to come back to this at a later date do let us know and I'll do my best to help out.
    Andy Campbell Smith

    Red Gate Technical Support Engineer
  • TheSQLDudeTheSQLDude Posts: 1 New member
    I would like to re-open this issue for present concerns.  What is the default behavior of the Red-Gate Data Synch tool when migrating identified differences from a table with an active IDENTITY INSERT Column configured to another table on a different server which also has to have the same IDENTITY INSERT Column configured after the synch-up is completed?  Do we have to temporarily turn off IDENTITY_INSERT on the destination server then turn it back on after the synchronization has completed or is there another alternative available?  This is for an upgrade migration from SQL 2008 to SQL 2019.
Sign In or Register to comment.