Synchronize

  • Please help me.

    I have two database the same structurer, but these Databases at diference position, now I want synchronize data.Please give me a solution.

    Thanks

  • This was removed by the editor as SPAM

  • You can do it by just comparing one table at a time, using different queries to identify which rows need to be added, deleted, or updated. Red Gate as a data compare tool that I use for stuff like that, Lockwood has a similar tool which I have not yet tried. Regardless, it's fairly straightforward sql to get the rows. Hard part is if the data is changing beneath you, if so, better to do when the fewest changes are being made.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • If you have a slow link between the databases, running queries to know the differences can be too slow. So you can export to files the tables that you want to check and then copy them to your server, import them into temp tables and then run those queries locally.

    To know what records are missing in both dbs, run left and right joins, and to know if you have different values on records, you can use a inner join, specifying in the where c1 <> c2 OR ...

    You can also use CHECKSUM_AGG(BINARY_CHECKSUM(*)) to know if you still have any diferences in count and in values.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply