DisableKeys Option in SqlDataCompare

JamesJames Posts: 4
Using the DisableKeys option does not seem to work using SqlDataCompare.

The generated SqlDataCompare script is attempting to delete rows in a parent table. This is failing as the table in question contains keys that are in use by foreign key relationships.

What needs to happen, of course, is that the foreign keys are disabled first, then the deletes and inserts occur, followed by the enabling of the foreign keys. After reading the help file I found the 'DisableKeys' option.

Unfortunatley this does not seem to have any affect. What am I missing? I have tried using both the command line and GUI versions of SqlDataCompare.

Thanks in advance.

James

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello James,

    Can you please check something: do the foreign keys get dropped if you include both tables in the relationship in the synchronization? I suspect that Data Compare is only dropping keys if it finds one as a constraint on one of the tables that you are synchronizing. If the foreign key is defined on another table that is not included as part of the synchronizaation, I think that maybe the key doesn't get dropped.

    Also, what version of Data Compare have you got?

    Thanks!
  • Brian

    Aha! - You are quite right!

    My overall goal is to update/sychronise only lookup table information as I move between database environments.

    Is there any thing I can do about this? Can I fake it out somehow?

    I am using version 3.4.0.8 of SqlDataCompare.

    Love the tool, BTW. It saves me many hours and days of tedious SQL script writing.

    James
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi James,

    I don't know any way of fooling Data Compare into disabling a key from another table. I will bring the issue up again here internally. I think the software is meant to disbale any relevant foreign key, regardless of which table in the relationship the actual constraint is applied to.
  • Thanks Brian - I appreciate your assistance. Have a nice day.
This discussion has been closed.