Red Gate forums :: View topic - Undo
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK Previous Versions
SQL Comparison SDK Previous Versions forum

Undo

Search in SQL Comparison SDK Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
mtran



Joined: 07 Oct 2008
Posts: 25

PostPosted: Tue Nov 04, 2008 12:55 am    Post subject: Undo Reply with quote

Is there anyway to undo a successful synchronization of both SQL Compare and SQL Data Compare?
Back to top
View user's profile Send private message
Chris Auckland



Joined: 24 Oct 2006
Posts: 757
Location: Red Gate Software Ltd.

PostPosted: Tue Nov 04, 2008 6:24 pm    Post subject: Reply with quote

Unfortunately not, the changes made are permanent.

The only way to reverse the changes would be to restore from a backup.
_________________
Chris
Back to top
View user's profile Send private message Send e-mail
Simon C



Joined: 26 Feb 2008
Posts: 140
Location: Red Gate Software

PostPosted: Tue Nov 04, 2008 7:01 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
mtran



Joined: 07 Oct 2008
Posts: 25

PostPosted: Wed Nov 05, 2008 4:19 pm    Post subject: Reply with quote

So to create the undo script:
Code:
           
            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
Back to top
View user's profile Send private message
Simon C



Joined: 26 Feb 2008
Posts: 140
Location: Red Gate Software

PostPosted: Wed Nov 05, 2008 4:48 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group