DisableAndReenableDMLTriggers not found in SDK

aufderaufder Posts: 3
Hi.
The command line for SQLDataCompare.exe has an Options option that allows DisableAndReenableDMLTriggers which emits SQL for Disabling and Enabling DML triggers. However the DisableAndReenableDMLTriggers value is not found in any of the options enums in the SDK 8. I'm trying to reproduce behavior via the SDK and get similar output as the command line app, but the SDK code doesn't produce Disable/Enable statements for DML triggers. Is there a way to do this via the SDK?

I have SQL Data Compare 8.1.0.4, and the version of the RedGate.SQLDataCompare.Engine.dll in SDK8 folder is 7.1.0.230 (which seems odd to be 7...)

Thanks

Comments

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

    Just to clarify, the comparison SDK is still shipping with SQL Data Compare v7 components because the product is versioned after the SQL Compare components, which were at version 8 at the time. If you require the latest components, there is an untested beta available (cumulative patch) for you to use.

    Anyway, to get the DML triggers disabled in the migration SQL, you may add "DisableTriggers" setting to the SqlOptions you're using. For example:
    provider.Options = new EngineDataCompareOptions(
                        MappingOptions.Default,
                        ComparisonOptions.TrimTrailingSpaces | ComparisonOptions.Default,
                        SqlOptions.Default | SqlOptions.DisableTriggers);
    
    Please feel free to let us know if this works for you.
  • Hi,
    Just disabling isn't enough. We'd want the generated script to re-enable afterward.
    In the end it's no rush, since the first table we're supporting with this isn't critical to have the DML triggers disabled. But in the future we'd look forward to having the SDK supporting disable/enable.

    Thanks for the quick reply.
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hi Alan,

    The option is meant to script a drop and recreate of the triggers.

    Maybe you have found a bug and you could try using the latest patch to the SDK?
Sign In or Register to comment.