Compare same Databases and Tables, one is present on the on-premise sql server and the other one present on the Azure cloud

Nilesh Patel 111 Reputation points
2021-12-03T10:06:24.267+00:00

Want to compare the same databases and tables after the migration from the on-premise SQL server to the Azure SQL database.
Is there any script that can compare all the databases, tables, functions, stored procedures in one go? So that I can make sure all the things are migrated and none of the data is misplaced.

e.g., let say I have 5 rows and 6 columns in a table on on-premise SQL server and after the migration I want to check all the rows and columns are present in the target.

I have large numbers of databases and tables. So, Can't do this manually for each databases and tables, need to automate this so I can save time.

Thanks.

Azure SQL Database
SQL Server Migration Assistant
SQL Server Migration Assistant
A Microsoft tool designed to automate database migration to SQL Server from Access, DB2, MySQL, Oracle, and SAP ASE.
496 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,559 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Olaf Helper 41,006 Reputation points
    2021-12-03T10:16:19.557+00:00

    Microsoft release a new, free tool: Database Compare Utility

    1 person found this answer helpful.

  2. Alberto Morillo 32,896 Reputation points MVP
    2021-12-03T13:08:36.967+00:00

    Allow me to recommend SQLDBDiff, this commercial tool that will simplify the post-migration validation test by comparing data and schema between source and destination databases. It supports SQL Server Version 2005 to 2019, SQL Azure and SQL on Linux. There is free version and a commercial version.

    1 person found this answer helpful.

  3. Erland Sommarskog 101.9K Reputation points MVP
    2021-12-03T23:03:09.68+00:00

    In addition to the other suggestions, there is a very good database compare tool in Visual Studio, once you have installed SSDT, SQL Server Data Tools.

    1 person found this answer helpful.

  4. AmeliaGu-MSFT 13,961 Reputation points Microsoft Vendor
    2021-12-06T07:54:41.7+00:00

    Hi NileshPatel-7672,
    You can go to SSDT Tools menu ->SQL Server-> new data comparison to compare data (record to record) between SQL Server databases and Azure SQL databases; and new schema comparison to compare schema (field to field).

    155176-image.png

    Please refer to Use Schema Compare to Compare Different Database and Compare and Synchronize the Data of Two Databases which might be helpful.

    Best Regards,
    Amelia


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.