My database requires a number of external databases and at the end of each day are updated to an unlinked (often offline) master database using append queries to the external database. Data only ever goes from satellite to master.
The way this currently works is when a new record is created or modified in the satellite database the (ModifiedDate) field is automatically updated to the current time and the (AppendedDate) field is left blank. Each record also has a replication ID (not used as primary key).
When I append new records to the master database, the Append query searches for instances where ModifiedDate is later than AppendedDate and appends them to the master database. The (AppendedDate) is then updated to the current time so that next time these records are skipped.
The problem I just realized is that if any data is modified in the satellite database AFTER those records have been appended, I will get a key violation because there is already an existing replicationID in the master database from when that record was originally appended.
I'm not sure how to get around this. Like I said I cannot link the tables because these databases are often stored offline and the master gets updated manually when I want it to. Perhaps there is a way to overwrite the replication ID occasionally (I know this defeats the purpose of having a replicationID), or I could run update queries based on the Date fields and joined on the replicationID? I don't know how to do the latter however.
Thank you.