Keep a table current on a schedule

DBCopier » Use cases » Keep a table in sync on a schedule

Download DBCopier Free Trial »     Buy DBCopier Now »

The situation

One table - orders, stock, readings, a price list - has to be current in a second database every morning. It is not the whole database, and it is not a one-off migration: it is the same copy, again and again, and the target must not end up with yesterday's rows twice.

Writing that by hand means a staging table, a delete and an insert, or a merge statement that is easy to get wrong.

What you do

  1. Set up the copy once: source table, target table, column mapping. Choose update / upsert as the write mode, so existing rows are updated instead of duplicated.
  2. Save the settings as a session.
  3. Run it from the command line on a schedule - Windows Task Scheduler, cron, or your own pipeline. Each run reads the source and applies the difference.

Table to table copy settings in DBCopier

Because it connects directly to both databases, there is no intermediate file to clean up and no place for the data to sit. The run produces a log, so a failed night is visible the next morning.

What it will not do

Related

The write mode: table to table. From a query instead: query to table. Copying on a schedule with the sample script: scheduled task, command line. Across engines: supported conversions.