Two way compare

Compares and synchronizes SQL database content.

Moderators: Chris Auckland, David Atkinson, richardjm, david connell

Two way compare

Postby smccloud » Tue Jan 10, 2012 8:08 pm

Hello,

I am trying to setup SQL Data Compare to do a two way compare (i.e. sync) of two databases. Basically, any changes in database 1 should propagate to database 2 and any changes database 2 should propagate to database 1. Is the only way to do this two separate projects in SQL Data Compare? I'm not seeing any way to do it with one project.
smccloud
 
Posts: 5
Joined: Mon Apr 04, 2011 6:37 pm

Postby james.billings » Tue Jan 10, 2012 9:30 pm

You're right, you can't do it. SQL Data Compar works on a Source > Target synchronization method, it's not bidirectional.
You'd need to run it twice to get records added in each database to end up in the other. You will also need to set a selection so that just "new" records in the source are added - otherwise the default behaviour would be to remove records from the target that didn't exist in the source.

In short - a standard one-way sync would try to make the databases identical.

You may encounter other difficulties- for instance, it won't be able to handle records that have been changed in both databases (once the first sync completes, the records will match as DB2 will be updated to match DB1, and the second sync wouldn't see any differences to send back the other way)
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.

Re:

Postby smccloud » Tue Jan 10, 2012 10:55 pm

james.billings wrote:You're right, you can't do it. SQL Data Compar works on a Source > Target synchronization method, it's not bidirectional.
You'd need to run it twice to get records added in each database to end up in the other. You will also need to set a selection so that just "new" records in the source are added - otherwise the default behaviour would be to remove records from the target that didn't exist in the source.

In short - a standard one-way sync would try to make the databases identical.

You may encounter other difficulties- for instance, it won't be able to handle records that have been changed in both databases (once the first sync completes, the records will match as DB2 will be updated to match DB1, and the second sync wouldn't see any differences to send back the other way)


The data we are syncing shouldn't cause this issue. I will go down the road where only new & changed records are synced & nothing is deleted from the target database. Thank you for your help.
smccloud
 
Posts: 5
Joined: Mon Apr 04, 2011 6:37 pm


Return to SQL Data Compare Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests