SQL Server to Databricks migration and validation
A distributor wants to move inventory analytics from SQL Server to Databricks while warehouse applications continue recording receipts, transfers and reversals. The operational question is straightforward: can the new reporting platform explain the stock balance at each location, including adjustments made after the original movement?
This illustrative scenario needs more than a table copy. Inventory has identities, effective times, valuation rules and historical corrections. DataDios can help compare the agreed representations and investigate differences; the migration team still needs to define which business state each load represents and which reports are ready to move.
Define current stock and historical movement separately
Use an inventory movement dataset as the first acceptance unit. Preserve the source movement identifier, product, location, quantity, valuation amount and event time in the landing table. Keep pipeline run identifiers available for investigation, but do not map them as business values unless they are part of the acceptance requirement.
Validate current stock as a derived result at product-location grain. A movement table can contain several legitimate rows for the same product; a stock balance should not. If SQL Server temporal tables are involved, record whether the target includes current rows, historical versions or both. A movement identifier unique in the current table may repeat in history, so the historical comparison needs an agreed version identity as well.
Choose a source boundary and identify the target load that corresponds to it. Include a reversal, a late backdated movement, a transfer across locations and a retried delivery. Check both sides of a transfer coherently. Otherwise a partially loaded transfer can look like a loss at one location and an unexplained gain at another.
Make five source-specific choices visible
| Issue | Business risk | Required decision and check |
|---|---|---|
| Identity and temporal versions | Retried or historical rows inflate stock | Preserve business identity; validate current and history keys separately |
rowversion | A change token is treated as an event timestamp | Preserve its agreed binary representation; use actual event fields for business time |
datetimeoffset and business day | Transfers fall into different reporting periods | Define instant, original offset and reporting timezone requirements |
| Money, decimals and valuation logic | Correct quantities produce incorrect stock value | Preserve scale and reconcile exact valuation totals independently |
| Schema changes and omitted fields | Old rows lack a newly included business attribute | Inventory exclusions and explicitly verify historical coverage after changes |
SQL Server rowversion is a binary change token, not a date/time field. For Lakeflow Connect specifically, Databricks documents ROWVERSION as BINARY, DATETIMEOFFSET as STRING, and MONEY as DECIMAL(19,4). These are ingestion mappings; do not assume that a string offset timestamp has already been converted to your reporting timezone. See the SQL Server connector reference.
If your Lakeflow configuration excluded a column, subsequently including it does not automatically backfill its historical values. Plan a supported refresh/backfill and prove coverage for old rows before using that attribute in reporting. This matters when a location classification or valuation flag is added halfway through migration. See the SQL Server connector limitations.
Configure the comparison around business identity
Create the SQL Server connection, then follow the Databricks destination prerequisites. The target principal needs access to the SQL Warehouse and selected catalog, schema and tables. Both connector types are enabled for SmartDiff; this does not establish that your data, transformations or scale have already passed a benchmark.
Choose the Databricks key explicitly. DataDios does not discover Databricks primary-key constraints, and a declared target constraint is not evidence that the actual rows are unique. Check null and duplicate keys independently before interpreting missing or changed records. Keep target-generated surrogate identifiers out of the matching contract unless an approved mapping relates them to source identities.
Use bounded, aligned snapshot tables for Data Source Diff. Use paired Query Diff projections when comparing filtered scopes or transformed representations, with the same cutoff and grain on each side. Analyze the query pair and select the comparison keys; a small returned preview is a configuration aid, not proof of whole-dataset coverage. Review Databricks batching and type handling: non-batchable keys may require whole-table reads, and a batch-size setting is not a hard memory cap.
Keep exact financial acceptance outside DataDios double-precision decimal comparison. Native totals by location, product category and currency can expose valuation issues that a high record-match percentage obscures. Retain both quantities and exact values; an amount total alone can hide offsetting mistakes between locations.
Turn mismatches into a repairable investigation
Consider this synthetic example, with 240,000 expected movement records in a completed wave. These figures demonstrate an investigation, not a measured product result.
| Cohort observed | Question to answer | Evidence to retain |
|---|---|---|
| 32 source-only movement keys | Was a final change segment omitted? | Source boundary, pipeline completion and representative movement IDs |
| 14 target-only keys | Is this a later load or an unintended historical scope? | Effective/version times and the agreed history filter |
| 41 matched movements with quantity differences | Were reversals or sign rules transformed incorrectly? | Original transaction type, raw quantity and target expression |
| 9 matched movements with date differences | Was the offset string parsed under a different timezone? | Raw offset value and the approved business-day derivation |
A movement can have both a quantity and a date difference. These field cohorts may overlap; do not add them into a distinct-row total or add missing/new records to an overall Diffs count that includes them. The synthetic table is not a complete result summary.
In Results, open the affected movement table. Use Diff by column for quantity, then Only diffs with inline or side-by-side highlighted values to distinguish a reversed sign from a changed magnitude. Cluster patterns are deterministic investigation hints, not a causal verdict. Review Summary value frequencies for concentration around a transaction value or status, then inspect original transactions. Export available table evidence for the inventory owner; standard clusters retain up to 1,000 examples, so exported retained detail does not enumerate every affected record.
The cohorts organize work; they do not establish causes automatically. Follow a source-only movement through extraction and landing before changing comparison settings. Inspect a reversed movement alongside its original transaction. For the date cohort, compare the instant and the reporting date separately: two different strings may represent the same instant, while identical wall-clock text may represent different instants.
SmartDiff result views can help inspect changed cells and frequencies. Treat retained examples as samples of a larger cluster, not a complete exception ledger. Root-cause badges suggest patterns rather than proving an ingestion defect. Use the shared investigation method to separate coverage, representation and business-rule issues, then rerun the corrected scope and dependent stock report.
Run a performance experiment that respects the metrics
Choose a representative stock-aging report and its upstream refresh. Hold accepted input scope, output rules and concurrency constant. Record the SQL Server environment, target warehouse configuration, cache conditions, background activity and number of repeated runs. Measure complete report delivery, not only one successful SQL statement.
SQL Server Performance Analyzer exposes query CPU, elapsed time, reads, memory grants and other DMV evidence. Its query workload uses daily snapshots of cached-plan statistics. Many totals are since the plan was cached, even when the chart displays a selected collection window. The maximum elapsed-time view also retains that since-cache meaning. These values help identify costly queries; they are not a direct before-window versus after-window benchmark.
Use a controlled run log for the actual source-target latency comparison. On Databricks, query-history metrics distinguish execution duration from waiting for capacity or compute; access to the relevant system tables is required. Inspect queueing before attributing a slow result to SQL translation. Compare the accepted report and refresh cost under the same workload, including validation compute and parallel operation.
Pin fixed-window evidence to a dashboard and label source, metric semantics and experiment identifier. DataDios does not automatically normalize SQL Server cached counters into Databricks per-query durations or match rewritten queries across engines. Query plans and AI insights, where available, support investigation; changes still need testing against both correctness and runtime requirements.
Experiment hypothesis: a translated stock-aging query is slow because it waits for Databricks compute, rather than because its joins became expensive. Repeat with documented comparable compute availability, then compare queue and execution durations separately. If execution remains slow, inspect the translated joins and accepted output before testing another change.
Hand over a clear decision
The acceptance record should name the wave, source/target boundaries, current/history scope, key tests, completed partitions, difference cohorts and unresolved exceptions. Attach exact quantity and valuation totals, transformation approvals, corrected-run references, representative report checks and access verification. Record rollback ownership and how post-switch movements would be reconciled if readers return to SQL Server.
An enterprise can approve waves by warehouse region with one shared mapping version. A smaller distributor can begin with one location and its essential stock report, then expand after a complete reporting cycle. Track hours to resolve a failed wave, time to approve an accepted dataset, and measured report delivery. A claimed savings should include the work of maintaining both systems during transition.
Review your SQL Server to Databricks plan