MssqlMerge is an easy to use diff & merge tool for Microsoft SQL Server databases. This tool allows to compare and import/export the most common database programming objects and the data between two databases. Supported SQL Server versions are 2005, 2008, 2008R2, 2012, 2014, 2016, 2017, 2019 and SQL Azure. MssqlMerge can run in two modes - basic free version and paid Pro mode that provides extended functionality and overcomes limitations of the free version.
Free version allows to compare table definitions, diff and merge views, functions and stored procedures. It also provides basic data diff and merge facilities, allowing to compare table contents, merge the whole records or only required columns for chosen records.
Pro version has a number of significant functional improvements, such as batch data diff, query result diff and more. In addition it has a lot of small nice refinements that will make your work much more productive.
Download installation package, install and run. On the first run it will ask you to choose which application mode would you prefer - Free, Pro Trial or to activate purchased key for Pro.
Rest of this demo applicable both for Free and Pro. In case if some screenshot has changes between Free and Pro - you can switch which one you want to see using toggle under the picture.
In the main application window, click 'Open Database(s) (Ctrl+O)' toolbar button to open required databases:
Note that for each database you can save database connectivity settings to the special *.msdbs file which can be opened later with 'Open *.msdbs file(s) (Ctrl+Shift+O)' command, this will allow you to skip filling all these details next time. Once you click OK in this dialog, it will read database object definitions and will provide such kind of summary:
Please note that for tables new/changed counts are not related to table data. Table is counted as changed if it has some column changes, like changed data types or new columns.
Using "total/new/changed/new+changed" links you can navigate to required object type, for example to Views:
On this screen using toolbar, you can:
Note that merge/replace/delete actions are not applicable for tables and user-defined table types (you could notice that they are marked with DIFF ONLY in Project tab). For other object types such actions will display a confirmation screen with the merge script that is going to be executed:
Note that program will ask for your confirmation for any data or object definition change generated by the program. It does not do any modifications on its own. It worth to mention here the Query Result Diff feature in Pro version, where program executes arbitrary user query. This query is entered by user and potentially can contain stored procedure calls or some other statements that can cause data modification.
From the object list you can navigate to some particular object and compare its definition:
Program also allows to diff and merge table data (with Pro you can also compare data for views). Navigating from Project -> Tables you will see button - 'Сompare data (all records)' for each table, which will open table diff window. If you have a lot of unchanged records and you need only to review changed - you can use button - 'Compare data (only new or changed records)'. The same way as for objects list you can switch to all/new/changed/new+changed records. Table diff window will indicate new/missed/changed records and missed fields, for changed records it will highlight fields with updated values:
Here you can merge data from one file to another. Mark records and fields that needs to be merged and use toolbar merge buttons. Toolbar selection buttons can be used for batch selection update. Merge action will display a confirmation screen with the merge script that is going to be executed:
Another useful feature is search for text across all project object definitions (but not across the data). This can be very helpful for example if you want to find all references to some particular field or table in all object types: