I’am looking to mirror records between two databases. The easiest method is to truncate the records in the destination and bulk the data from the source to the destination but this is a bad way, during this actions, users can’t use the remote database.
Suppose I have this records :
How I can simply :
- Add records from LocalTable with ID not existing in RemoteTable (like ID 3)
- Delete records in RemoteTable where ID not existing in LocalTable (like ID 4)
- Update records where fields where not strictly equals (like ID 2)
- Do nothing with the rest (or just an update like the previous line)
Do you have an example ?