Short answer: store a watermark per table, the latest change you already loaded. Each run reads the highest change value in the source first, copies the rows between the old watermark and that value, merges them into the target by key, and only then moves the watermark on. A failed run leaves the watermark where it was, so the next run picks the same rows up again.
A full copy every night is simple, and it gets slower every month the data grows. Most tables have a column that says when a row last changed, usually a modified date. That column is enough to ask the source for the new rows only.
What is a watermark?
The highest value of the change column you have already loaded. Everything above it is new to you; everything at or below it you already have.
| SalesOrderID | ModifiedDate | Status |
|---|---|---|
| 71774 | 2026-10-25 22:10 | Shipped |
| 71776 | 2026-10-26 09:42 | Shipped |
| LastWatermark 2026-10-26 09:42 | ||
| 71780 | 2026-10-27 14:05 | Ordered |
| 71776 | 2026-10-27 18:31 | Returned |
| NewWatermark 2026-10-27 18:31 | ||
Order 71776 shows up twice: the version the last run loaded, and the same order after it was returned. That second version is why the target needs a merge by key, not an insert: the changed row has to replace the old one.
How does one run work?
- 1Read the new watermarkMAX(ModifiedDate) in the source, before copying
- 2Copy the rows in betweenabove the old watermark, up to the new one
- 3Merge by keyupdate what changed, insert what is new
- 4Move the watermarkonly when the merge succeeded
Reading the new watermark before the copy matters. A row that changes while the copy runs gets a later date than the value you read, so the next run copies it, instead of the watermark jumping past it.
The copy's source query in Data Factory, inside a ForEach over the control table:
SELECT * FROM @{item().SchemaName}.@{item().TableName}
WHERE @{item().WatermarkColumn} > '@{item().LastWatermark}'
AND @{item().WatermarkColumn} <= '@{activity('New watermark').output.firstRow.NewWatermark}'The rows land in a staging table, and one stored procedure merges them into the target:
MERGE dbo.SalesOrderHeader AS t
USING stage.SalesOrderHeader AS s
ON t.SalesOrderID = s.SalesOrderID
WHEN MATCHED THEN
UPDATE SET t.Status = s.Status, t.ModifiedDate = s.ModifiedDate
WHEN NOT MATCHED BY TARGET THEN
INSERT (SalesOrderID, Status, ModifiedDate)
VALUES (s.SalesOrderID, s.Status, s.ModifiedDate);The last step is a second stored procedure that writes the new watermark into the control table, on the Copy's and the merge's success path only.
Why not just copy the rows since yesterday?
Because "yesterday" is a guess about when the last run worked. If Tuesday's run fails and nobody notices until Thursday, a load of "the last 24 hours" has lost Tuesday's changes for good. The watermark is a fact about what you actually loaded, so a failed run, a paused trigger or a week's holiday all catch up on their own.
What does a watermark not catch?
- Deleted rows. A deleted row has no modified date; it is simply gone. If deletes matter, use soft deletes in the source, or change tracking or change data capture, which record them.
- Changes that do not touch the column. A bulk update that forgets to set
ModifiedDateis invisible. Check with the source team how the column is maintained before you trust it. - Clock and time zone surprises. Compare like with like: if the source writes local time, keep the watermark in local time too, or convert both.
Where can you check this?
- Microsoft Learn: Incrementally load data from a source data store to a destination
- Microsoft Learn: MERGE (Transact-SQL)
- Microsoft Learn: About change tracking (SQL Server)
Where do you start?
The last lesson of Your first metadata-driven pipeline adds the watermark to a pipeline you build yourself, and Upserts into Azure SQL covers the staging table, the merge and a log of every run. The same idea in a Fabric lakehouse is Incremental loads in a lakehouse.