What are the challenges you face when working across database platforms? Take the survey
Options

Undo

mtranmtran Posts: 34
Is there anyway to undo a successful synchronization of both SQL Compare and SQL Data Compare?

Comments

  • Options
    Unfortunately not, the changes made are permanent.

    The only way to reverse the changes would be to restore from a backup.
    Chris
  • Options
    In the future, you can create a rollback script when you create the initial sync script by creating a new Work class with the runOnTwo argument to the BuildFromDifferences method negated. This will produce a sync script going the other way, if you wanted to undo the changes made by the first script.

    Simon C
  • Options
    So to create the undo script:
                Work work = new Work();
                work.BuildFromDifferences(difference, Options.Default, false);
                using (ExecutionBlock block = work.ExecutionBlock)
                {
                    string sql = block.GetString();
                    difference.Database1.Dispose();
                    difference.Database2.Dispose();                
                    return sql;
                }
    

    I just need to set that flag to false?

    Thanks,
    Meng
  • Options
    correct - if runOnTwo is true, the sync script will go from DB1 -> DB2. If false, it will go from DB2 -> DB1. Changing runOnTwo does the same thing as flipping the synchronization direction in the SQL Compare UI.

    Simon C
Sign In or Register to comment.