Wrong Sync Order

ivarleyivarley Posts: 3
edited November 19, 2009 6:02AM in SQL Compare Previous Versions
Hello,

On attempting a database synchronization with SQL Compare 8, it is failing because the commands are in the wrong order based on dependencies. In particular, I've added a column to a table, and then also referenced that column in an altered procedure. If the ALTER TABLE statement came before the ALTER PROCEDURE statement, it'd be no problem; however, it's attempting to do the ALTER PROCEDURE statement first, and failing. Is there any way to avoid and / or control this, short of having to do two separate synchronization operations (one for the tables, and a second for the procedures)? It seems kind of dumb to me to have the procs interleaved with the tables, as it's almost always safer to do all the table changes first. The objects appear in the right order in the Wizard, but then the actual script that gets generated is in the wrong order.

Thanks!
Ian Varley

Comments

  • Hi Ian,

    In my experience, scripting tables before stored procedures is not going to work 100% of the time, which is why SQL Compare constructs a dependency matrix to decide the scripting order of objects.

    It would be extremely helpful if you could email us a backup of the databases or a SQL Compare snapshot of them so that we could reproduce the problem and debug it in-house. Our address is support@red-gate.com. Don't forget to include your serial number (if you have one) and the version of the software you're using.
  • I am having a very simular issue where a stored proc is being updated before the column is added. Is there a way to force order? I am using SQL COmpare 8.1 for the Cmd line via an automated powershell script.

    thanks,

    BJHop
  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Sorry to say that there is no way to influence the object scripting order in SQL Compare. You'll want to contact support and send a backup, snapshot, or script to recreate the fault, if at all possible.
Sign In or Register to comment.