exclude dependencies

SuleonSuleon Posts: 17
edited April 26, 2007 6:58AM in SQL Compare Previous Versions
Hello!

I want to compare and synchronize two databases. In my Master database there are several new tables which are referenced in other tables.

I first want to create the new tables in the second database and afterwards fill the tables manually. I do not want to create the foreign keys to the new tables, because that would fail because of the missing datas.

So I removed the check "include dependencies" and only checked the new tables for synchronisation. But when I run the synchronisation the foreign keys to the new tables are included and raise an error.

Is this a bug or how can I do my synchronisation correctly?

Regards
Susanne

Comments

  • Hi Susanne,

    Unchecking "include dependencies" only stops dependent tables referenced by foreign keys being included in the script, the foreign keys on the referencing tables will still be scripted. To stop this occurring you need to enable the "Ignore Foreign Keys" option in the "More Options" dialog. Then you should be the behaviour you are after.

    Hope this helps.

    Regards,

    Jonathan
    Jonathan Watts

    -Project Manager
    -Red Gate Software Ltd
  • Hello Jonathan,

    I tried this option. Now foreign keys are ignored at all. That works, but that's not exactly what I desired.

    My scenario:
    If I have new tables A and B with foreign key A->B. And an existing table C with new foreign key to C->A. I first want to insert tables A and B with key A->B. then fill the tables with data and then add the foreign key C->A

    I do not understand why the key C->A is a dependency when I just include A and B. But that's the way it is :)

    Thank you!
    Susanne
  • Susanne,

    Ah, I see what you mean. It looks like you have found a bug :oops:. As I suggested above the work around would be to ignore the foreign keys and synchronise the tables. Then disable the ignore foreign key option and synchronise the foreign keys.

    Sorry about this I know it is a bit messy, but hopefully this will work until we can get it fixed.

    Regards,

    Jonathan
    Jonathan Watts

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