SQL Server to Databricks: Preserve Reporting History
Keep past work assigned to the team responsible at the time.
A warehouse migration can preserve every job and hour yet change which team receives the credit. Before the first Databricks release, carry over the SQL Server fact rows, business-effective team versions and the keys that connect them. Then compare the historical report at the row level, including transfer dates and late-arriving work.
Agree on what “historical” means
A slowly changing dimension, or SCD, Type 2 keeps versions instead of overwriting an attribute with its latest value. But the meaning of its dates still needs to be established. A period might describe when a team assignment took effect in the business, when a database recorded it, or when a pipeline received it. Databricks: current state and historical tracking.
SQL Server system-versioned temporal tables are a separate mechanism. Their system periods use the transaction’s begin time in UTC. A column named ValidFrom does not, by itself, establish a business-effective date. Microsoft: temporal tables.
Microsoft explicitly notes that transaction-time validity is suitable for a dimension only when it fits the business logic; delayed loading can make it unsuitable. Inspect the source report’s actual join and date rule before translating it. Temporal usage considerations.
For the report here, the rule is clear: attribute each job to the team responsible on its completion date, using the accepted business-effective history. A current-team view of past work may also be useful, but it must be named and approved as a different report.
Six jobs can reconcile and still tell the wrong story
Consider a North American field-service operation. Technician T17 belongs to East until July 1, then moves to West. Technician T28 remains in East. The source warehouse retains both T17 versions: key 101 for East and key 102 for West. T28’s East version has key 201.
The report includes six jobs. T17 completes two before the move, taking two and three hours, and two after the move, taking four and one hour. T28 completes two jobs taking five and six hours.
| Report meaning | East | West | Total |
|---|---|---|---|
| Team responsible at completion | 4 jobs / 16 hours | 2 jobs / 5 hours | 6 jobs / 21 hours |
| All work restated under today’s team | 2 jobs / 11 hours | 4 jobs / 10 hours | 6 jobs / 21 hours |
Both results contain six jobs and 21 hours. Only the first preserves the established historical report. The second becomes a migration defect if it replaces that report without an approved change in meaning.
This can happen even when all three dimension versions reached Databricks. A report that filters the dimension to its current rows and joins by technician ID still moves T17’s earlier work to West.
The acceptance test therefore needs the assigned team and dimension version for each job, not only matching row counts and hours.
Carry the existing history across
For this first release, preserve keys 101, 102 and 201, their business-effective periods, and the fact rows that reference them. If keys must change, build an explicit mapping and apply it consistently to every dependent fact. Do not regenerate dimension keys independently and hope the relationships survive.
A full snapshot of the history dimension contains all three versions and can preserve that existing history. A snapshot filtered to current technicians contains only two. Calling both extracts “the initial snapshot” hides an important difference.
Starting a new change data capture (CDC) feed does not recover earlier states that were never retained. Databricks documents a migration pattern that replays an existing SCD table’s history through a one-time AUTO CDC flow, then attaches ongoing changes. That pattern relies on historical source records and compatible sequencing; it is not a way to manufacture missing history. Historical backfill guidance.
For the example, copying the established version rows is the simpler first decision. Rebuilding them through an event-processing model can be evaluated later if it preserves the same periods, closures and fact relationships.
Check the boundary and the late job
Treat the example’s validity periods as start-inclusive and end-exclusive. T17’s East version ends when July 1 begins; the West version starts then. A July 1 job belongs to West only.
One June 30 job reaches the warehouse on July 12. It still belongs to East under the completion-date rule. Using its arrival date would change the report’s meaning.
Require every job to match exactly one dimension version. Check missing keys, duplicate version keys, overlapping periods and mismatches between the stored key and the completion-date interval. Databricks primary and foreign key constraints are informational rather than enforced, so the declarations do not replace these checks. Databricks constraints.
Design future history separately
Databricks AUTO CDC can build SCD Type 2 history from changes using declared keys and sequencing. The selected sequence must represent the intended ordering; a pipeline arrival timestamp should not be substituted for a business-effective date without a deliberate change in meaning. Check the requirements of the chosen Lakeflow pipeline route. AUTO CDC documentation.
There is another question this example does not answer: what would the organization have reported before the late job was known? That requires retained evidence of when information became available, as well as when the work occurred. Databricks documents bitemporal AUTO CDC for two time dimensions, currently in Beta. Its availability does not create missing historical evidence. Bitemporal AUTO CDC.
Similarly, Databricks table time travel concerns stored table versions and retention. It is not a substitute for migrating years of business history or a long-term archive. Table history.
Begin with one report and preserve its approved attribution rule. In this example, the result to protect is East’s four jobs and 16 hours, West’s two jobs and five hours, and the correct version behind every row. A later current-team report or history-processing redesign should be an explicit business choice.
The companion eGuide provides the six-job dataset, boundary checks, backfill decision and migration worksheet. Bring one historical report and its source tables to a discussion with KCM’s Databricks consulting team.
