Creating Foreign Key on a Table with missing Column

dbirdildbirdil Posts: 8
I tried to promote only new tables to the target database. SQL Compare added SQL in the script to add a foreign key to an existing table for a column that does not exist yet.

Other than modifying the scripts, how can I get this tool not to generate SQL for changes to tables that are not being promoted at this time? I just wanted to create the new tables and not alter the foreign keys on other tables.


  • Options
    Before you synchronized, did you check to see if the foreign key was added as a dependency of one of the new tables? Maybe turning off the 'include dependencies' option, at least temporarily, would cause this action to stop happening.
  • Options
    I tried turning off the Include Dependencies but it did not help.

    The foreign key will be added to existing table once the new column is added. Before that happens I need to create a new table whose primary key is contains the values for the new column on the existing table.

    SQL Compare when creating a new table should not generate foreign keys on other tables. Instead these foreign keys should be create when those tables changes are promoted.

    I tried promoting one table at a time but SQL Compare did not work.
  • Options

    Sorry, but I need to ask you for some SQL Compare schema snapshots from your databases. Can you please send them to support@red-gate.com? Also, can I verify you're using v5.2?
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Have you sent the schema snapshots? We got some in our email box that appear to be from you, but you are using a different email address.

Sign In or Register to comment.