Drop foreign key before sync

wwangwwang Posts: 2
Hi, we only want to sync data in a handful of tables between two databases. The problem is that another table (not included in the sync) has a foreign key reference on one of the tables that is going to be synchronized. Is there any way to handle drop and re-create this foreign key other than do it manually before data sync?


  • There is an option in the Project Configuration screen...

    Disable foreign keys

    ...which is on my default. If you are only comparing the one table there is a little trick to compare the table on which you want to drop the foreign key but include a WHERE clause something like '1=0' so that no rows are actually compared so no differences registered. However synchronizing it should spot the other table with the foreign key and drop it as you expect.

    Richard Mitchell
    Project Manager
    Red Gate Software Ltd
Sign In or Register to comment.