How do you validate a SQL Server to Azure SQL Database migration?

Profile every SQL Server table before the move, generate comparison tests from that profile, and run them on Azure SQL Database after each load. Compare counts, sums, lengths, date ranges, and value hashes column by column, write down the changes you meant to make, and sign off when every failure matches one. Row counts alone prove nothing about values.

Key points

  • SQL Server to Azure SQL Database is the gentlest Microsoft migration: same engine family, same T-SQL types, so most comparison failures point to a real data change rather than a type conversion.
  • DataOps TestGen's Table Comparison tests profile the SQL Server source and run on the Azure SQL target, checking counts, null counts, lengths, sums, date ranges, frequent values, and value hashes without moving data between them.
  • TestGen's text-hash tests need UTF-8 collations, available from SQL Server 2019 and in Azure SQL Database; on older SQL Server those tests miss changes to text columns.
  • In DataKitchen's October 2026 Jaffle Shop migration, a 55-test health suite passed after 483 orders were left behind, while 345 Table Comparison tests failed 61 times, each matching a planned change.
  • TestGen connects to SQL Server with a SQL login and to Azure SQL Database with a SQL login, managed identity, or Entra ID service principal; both read-only.

A SQL Server to Azure SQL Database move keeps the engine family and the T-SQL. That’s the good news: unlike a move to Fabric, your column types mostly survive. It also means a failing comparison test usually points at a real problem, not a type rule.

The general migration method covers the five pieces every migration needs. This page is the Azure SQL version.

What to compare

CheckWhat it catches
Row and column counts per tableRows left behind, columns dropped
Null and distinct counts per columnDefaults applied, collation changes
Minimum, maximum, and total lengthTruncated text from a narrower column
Sums, minimums, and maximums of numbersRounding, lost decimals
Minimum and maximum datesTime zone shifts
Value hashes, with and without the keyValues changed or swapped between rows

Row counts sit at the top of that list for a reason: they’re necessary. They just aren’t enough.

The steps with TestGen

TestGen’s Verify a Data Migration procedure, applied to Azure SQL:

  1. Connect to SQL Server with a read-only SQL login. In the source table group, turn on Profile for table comparison and turn off profile sampling.
  2. Run data profiling on the source and generate a suite with only the Table Comparison set.
  3. Connect to Azure SQL Database with a SQL login, managed identity, or Entra ID service principal, and add a firewall rule for the TestGen host. Create the destination suite and exclude it from quality scoring.
  4. If tables or columns were renamed, write the mapping CSV: source_table, source_column, target_table, target_column.
  5. Run transfer_tests.py to preview, read the report, then run it with --apply.
  6. Run the destination suite after each load and match every failure to your expected-differences list.

TestGen never copies rows between the two. It profiles the source where it lives, queries the target where it lives, and compares results, so a failure names the column that changed. Query both sides by key to find the rows.

SQL Server details that bite

In DataKitchen’s testing on three public datasets, Table Comparison caught 774 of 785 planted changes. The Jaffle Shop write-up shows the 61 failures and the planned change behind each.

Start at the Azure SQL install page, and see the Azure SQL setup answer for grants and firewall rules.

Frequently asked questions

Short answers to the follow-up questions people ask next.

What can go wrong in a SQL Server to Azure SQL Database migration?

Rows left behind by a failed batch, text truncated by a narrower column, dates shifted by a time zone conversion, values changed by a different collation, and keys regenerated by a reload. Most of these pass a row count and a health check. Column-level comparison against a profile of the source catches them.

Does collation matter when moving to Azure SQL Database?

It can. If source and target collations differ, comparisons of distinct counts can change: a case-insensitive collation counts ACME and acme as one value, and SQL Server treats values differing only in trailing spaces as one under any collation, per TestGen's migration docs. Keep the source collation, or list the change as expected.

How often should I run the comparison tests?

After every mock load and again at cutover. In DataKitchen's Jaffle Shop example, 345 Table Comparison tests ran in five seconds, so there's no reason to save them for the last weekend. Each run before cutover shrinks the list of surprises.

Do I need TestGen Enterprise to validate a migration?

Table Comparison is in both editions. A migration uses two connections at once, SQL Server and Azure SQL Database, and open-source TestGen allows one connection, so most migrations use Enterprise at $100 per user and $100 per connection per month for the project.

Try it on your own data

DataOps TestGen is free and open source. Profile a table and generate its tests this afternoon.