Incremental Load SQL Generator
Writes a watermark-based incremental extract query from a CREATE TABLE statement.
Loading the tool…
How to use this tool
- Paste the CREATE TABLE statement for the source table.
- Name the watermark column if the automatic guess picks the wrong one, and name the target table.
- Select Generate query, and review it before running it — nothing here has seen your database.
- Decide separately how deletes will be handled. A watermark query cannot see them.
What incremental load sql generator does
Reloading a whole table every night works until it does not, and the switch to incremental loading is nearly always the same query: find the highest timestamp already loaded, and pull everything above it. Simple enough to write from memory, and simple enough to get subtly wrong at three in the morning.
This writes it from the DDL, picking the watermark column automatically when a column looks like one and refusing rather than guessing when none does. It is worth being clear about what this approach cannot do: a watermark extract never sees a deleted row, and it misses updates that do not touch the watermark column. If either matters, you need change data capture rather than a query.