| Author |
Message |
mtran
Joined: 07 Oct 2008 Posts: 25
|
Posted: Tue Nov 04, 2008 12:55 am Post subject: Undo |
|
|
| Is there anyway to undo a successful synchronization of both SQL Compare and SQL Data Compare? |
|
| Back to top |
|
 |
Chris Auckland
Joined: 24 Oct 2006 Posts: 710 Location: Red Gate Software Ltd.
|
Posted: Tue Nov 04, 2008 6:24 pm Post subject: |
|
|
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 |
|
 |
Simon C
Joined: 26 Feb 2008 Posts: 140 Location: Red Gate Software
|
Posted: Tue Nov 04, 2008 7:01 pm Post subject: |
|
|
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 |
|
 |
mtran
Joined: 07 Oct 2008 Posts: 25
|
Posted: Wed Nov 05, 2008 4:19 pm Post subject: |
|
|
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 |
|
 |
Simon C
Joined: 26 Feb 2008 Posts: 140 Location: Red Gate Software
|
Posted: Wed Nov 05, 2008 4:48 pm Post subject: |
|
|
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 |
|
 |
|
|
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