How can we help you today? How can we help you today?

Creating Foreign Key on a Table with missing Column

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.
dbirdil
0

Comments

4 comments

  • Brian Donahue
    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.
    Brian Donahue
    0
  • dbirdil
    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.
    dbirdil
    0
  • Brian Donahue
    Hello,

    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?
    Brian Donahue
    0
  • Brian Donahue
    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.

    Thanks!
    Brian Donahue
    0

Add comment

Please sign in to leave a comment.