problem dropping constraints in version 11

todtrexlertodtrexler Posts: 7
edited February 19, 2015 11:55AM in SQL Compare 11
I have an issue where the scripts generated by SQL Compare 11 fail with errors such as the following:

[3725] The constraint 'PK_ExportParams' is being referenced by table 'DistrictExportParams', foreign key constraint 'FK_ExportParamDistrictExportParam'.
Could not drop constraint. See previous errors.

This happens when, for example, columns in the table ExportParams have been reordered.

In version 10, where my workflow was identical, I did not get this problem. Note that I do not ever select "Deploy All Dependancies" (have not done so in version 10, either) - this is due to the fact that this always deploys changes to my sequence objects, which causes issues.

As I said, my workflow and settings are identical between versions 10 and 11, but in 11 my scripts fail because the foreign key constraints on referencing tables are not dropped and re-added in the script.

Why has this changed? Is there somethign I can do to continue using version 11?

Thanks

Comments

  • Hello,

    Our apologies for the late reply through the forum.

    I do see that you have a ticket open with one of our Support Engineers. Just to reiterate his message, this is a bug within v.11, and it is scheduled to be fixed in v.11.2.

    Please let us know if you have any further questions in the meantime. Thank you for your time.

    Best,
    David
  • I'm pleased to tell you that this bug has been fixed in the latest version of SQL Compare, 11.1.2.28. You can get this version via Help -> Check for Updates..., or you can download it from here.
    Development Lead
    Redgate Software
  • I am using RedGate.SQLCompare.Engine.dll v 11.1.2.54 and I am still getting the following error:
    Error: The constraint 'PK_t_Folio' is being referenced by table 'CryptFolio', foreign key constraint 'FK_CryptOwner_t_Folio'.
    Could not drop constraint. See previous errors.

    I have both of these set in my code:

    options.SetOptions(Options.IgnoreConstraintNames, true);
    options.SetOptions(Options.IgnoreSystemNamedConstraintNames,true);

    And I am still getting the constraint error. Any thoughts?
  • It looks like there might be a problem with how you're using SetOptions - it's just a handy wrapper around Plus/Except, so it returns a new Options rather than mutating the existing one.

    I'm guessing you want something like this:
    options = options.Plus(Options.IgnoreConstraintNames, Options.IgnoreSystemNamedConstraintNames);
    

    Apologies if this wasn't clear.
Sign In or Register to comment.