On 13 Aug 2015, at 5:55am, Chris Parsonson <z2668856 at gmail.com> wrote:

> The tables are very simple. They have a primary key, but no relationship
> between tables in the sense that you mean. Synchronisation will be add new
> rows, and update some rows, no deletions

To access two different databases with one database connection, use the ATTACH 
command.

Method 1
--------

To find rows which are in one table but not in the other, use EXCEPT

SELECT primaryKeyColumn FROM databasea.myTable EXCEPT SELECT primaryKeyColumn 
FROM myTable

In cases where a row has been updated with a new value in one column, how do 
you propose to decide which value is the 'right' one to put in both databases ?

Method 2
--------

Ignore Method 1.  In each copy of your database keep a log of all INSERT and 
UPDATE commands executed since the last 'synchronize':

CREATE TABLE commandsSinceLastSynch (theCommand TEXT)

To synchronise the two copies, play back the log for copy A to copy B and the 
log for copy B to copy A.

Simon.

Reply via email to