Comments
Sort by recent activity
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. / comments
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...
Ahh, I see it now. I made my own workaround yesterday. I have a scheduled task running every 5 minutes on server a to sync it to server b then a task that runs on computer startup to sync from server b to server a. It "should" work..... / comments
Ahh, I see it now. I made my own workaround yesterday. I have a scheduled task running every 5 minutes on server a to sync it to server b then a task that runs on computer startup to sync from se...
james.billings wrote:
This can work to an extent - however you'll have trouble if records are added to both databases with the same primary key. When you run Data Compare against them, the records will be seen as matching, so the target will be updated to match the source. What it won't do is insert new records and alter the key so you can keep all records.
For example:
DB1 has records 1, 2, 3, 4, 5 added. DB2 already had 1, 2, 3. DB1 goes offline, and in the meantime, records 4 and 5 are added to DB2.
When you come to sync, if you go from DB1 > DB2, then the 4 and 5 in DB2 will be UPDATE'd to match DB1. It won't create records 6 and 7 for you.
As long as the keys differ though, it should work - you just need to remember to un-tick the "Target Only" column, and that will stop it deleting records in the target that don't exist in the source... for example:
DB has records 1, 2, 3, 4, 5. DB1 goes offline, so DB2 then has 6, 7, 8 added. When you come to sync later on, and go from DB1 > DB2, if you don't untick the "Target Only" column then records 6, 7, and 8 will be deleted from the target (DB2) as they don't exist in DB1.
Hope all that makes sense.
Where is the "Target Only" column? / comments
james.billings wrote:
This can work to an extent - however you'll have trouble if records are added to both databases with the same primary key. When you run Data Compare against them, the recor...