Merge 2 dbs with identical schemas

Hi,

I'm trying to find out if the following is possible with Redgate SQL Data Compare or any other Redgate tool.

I have 2 databases with identical table structures but different data, call them database A and Database B.
I want to merge the data from database A into database B but the same PK IDs (int) (and therefore FKs) are in use in both dbs. So as part of the merge I will need to re-allocate many PKs in the records in database A and also update all FKs referencing these updated PKs in order to maintain the referential integrity of the data from database A as it is merged/inserted into database B.

Initial investigation of the trial version of SQL Data Compare I can't see that the above is possible using this tool but I want to be sure before I discount this product as an option. Any help / confirmation much appreciated.

Many Thanks.
Tagged:

Comments

  • If the PKs are auto-inserting (e.g. with IDENTITY) then you should be able to do it - the trick is to choose a different comparison key (e.g. a username or some other identifying attribute of your data instead of the id column). You can do this in the Tables & Views tab of the Edit Project dialog.
    Software Developer
    Redgate Software
Sign In or Register to comment.