This article describes how a system including a SQL Server database schema compare tool, along with some PowerShell and a scheduler can keep the QA database in sync and up to date, and run automatically and unattended
This article describes how a system including a SQL Server database schema compare tool, along with some PowerShell and a scheduler can keep a source control repository in sync and up to date, in near real time, and run automatically and unattended
Microsoft Great Plains is a database that has over 1,000 tables and 11,000 stored procedures and a large amount of other objects contained in SQL. I have looked at many different products to show the differences between the different versions of GP and ApexSQL, in my opinion was the fastest. Since their new changes to ApexSQL Diff they've even surpassed their own record in how long it takes to compare the databases. I validate this because I didn't do an accurate timing 2 years ago but I'm pretty sure the comparison has gone from 10-15 minutes down to less than a few minutes. It's amazing how fast it really works!
Thank you for the fine product your company delivers (ApexSQL Diff). I have caused several companies to purchase this during my career as a DBA as I find it to be the best at reconciling database structure, hands down. I have successfully activated the software and as usual am extremely happy with the upgrade
Thank you for all the help! After working with ApexSQL Diff for so many years it is extremely encouraging to see your involvement in the direction of the products! I still remember when I first started using proc-blaster (many moons and employers ago)! The product line has come a long way since those days and I am encouraged by the direction the applications have gone. :) With each release you have made my life easier :)
ApexSQL Diff is indispensable to me to sync objects between databases, and especially between source control and production (enabling clear view of exact changes going into production) once amended objects are ready for deployment.
This video shows the core features of ApexSQL Data Diff, a SQL Server development tool that is capable of performing comparison and synchronization of data stored in tables or views, between different data sources. See how to perform schema and object mapping, object filtering, export the comparison reports, perform direct synchronization to a database and how to create a batch script for scheduling data comparison and synchronization.
This video shows the core features of ApexSQL Data Diff, a SQL Server development tool that is capable of performing comparison and synchronization of data stored in tables or views, between different data sources.
Hello and welcome to this ApexSQL Data Diff general overview video. ApexSQL Data Diff is a SQL Server development tool that is capable of performing comparison and synchronization of data stored in tables or views, between different data sources. Data sources include SQL Server databases, backups, source control projects and script folders. ApexSQL Data Diff also supports data synchronization for SQL Azure databases and SQL Server on Amazon RDS.
In case something goes wrong, as part of creating a synchronization script, ApexSQL Data Diff can reverse any changes made by automatically creating a backup or a rollback script prior to synchronization. It also supports creating executable installation packages that user can run without installing any other software.
Upon starting the application, the Project management window will be shown where a new project can be created or to open a previously saved project from the list. To initiate a new project, click the New button:
In the first tab of the New project window, the Data sources tab, source and destination data sources should be set. You can choose between four different data sources for both source and destination: backup, database, script folder, or source control. For the purpose of this video, databases are set for both source and destination, where a destination database will be synchronized with data from the source database:
The first one is the Package tab, in which a few options can be set for the executable installation packages, such as compression, error handling, logging, and optional package information.
The next tab, is the Schema mapping tab, that by default matches schemas with the same names in source and destination, but it also allows for customizing schema mapping pairs. For example, if you have differently named schemas, Report schema in source and Reporting schema in destination database, just pick them from the drop-down list in the first row, click the Add button, and all objects that have these two schema names will be paired:
If there are any objects with different schema and/or object names, those will be shown under the unmapped objects list. In this example, these two tables already have been mapped by schema, but they differ in the object name. However, if the structure of these objects is the same, select the source and destination object and click the Map button. Also, if there are differences in column names, select mapped objects and click the ellipse button to open the Mapping columns window. Here, you can easily map columns in the desired way and custom mapped object along with its columns will be included in the comparison process:
Once you switch to the Object filter tab, by default, all automatically mapped objects are checked. The Object filter tab allows various filtering options for tables and views:
The Filter editor allows specifying conditions for schema and object name in order to filter the list of objects that will be compared. To initiate the Filter editor, click the Edit filter button in the top-right corner and provide a desired condition. In this example, objects are filtered by schema name, so that only objects with schema name Person are shown:
The Custom comparison key allows the user to set the comparison key when there is no primary or foreign key. In order to set the customer comparison key, click the arrow button for the selected object under the Comparison key column and pick a column that will become the custom comparison key:
The Row filter allows specifying a condition for the Where clause, to limit the number of rows that will be compared. To set the condition, select an object from the list and click the ellipse button under the Row filter column. In the Row filter window, specify a desired condition, and in this example and check/uncheck whether to apply the same condition on both source and destination objects. In this example, the condition for the Person.Address table set, so instead of comparing all rows, the condition AddressID >= 1 AND AddressID
The last tab is the Additional scripts tab, in which Pre or Post processing scripts can be configured, that will be executed before or after the synchronization process. In this example, the Embedded script option is used as the Pre-processing script and a script to create a table is written, while for the Post-processing script an already created script that will create another table will be loaded using the Use this script option:
By clicking on the Export button from the Home tab, the comparison results can be exported into 4 different outputs: HTML simple and interactive report, Excel report and CSV data export:
If all desired objects and rows are checked for the synchronization process, click the Synchronize button from the Home tab to initiate the Synchronization wizard:
If this project needs to be repeated, it can be easily automated by creating a batch file that can be scheduled via SQL Server Job or Task Scheduler. To create and save the batch file, click the Save as batch button in the bottom-left corner of the Synchronization wizard:
As displayed, the batch script will contain all CLI switches for options that were set along the way, as the project was constructed. Additionally, you can automatically create a project file that will replace all project options and encrypt any passwords that you might have for SQL Server authentication or for the source control system. Once you reviewed and set everything that you need, click the Save button from the bottom-right corner of the Save as batch window and provide the location where it should be saved.
Click the Yes button and the synchronization script will start with execution. Once the synchronization process is done, the Results window will be shown along with all information messages about taken actions:
Once the execution results are saved and the Close button is clicked in the Results window, the re-comparison of data sources will be done and you can check if everything was properly synchronized.
Compare the data in all tables in two databases on different servers using SQL Server authentication, set data synchronization options, set synchronization record types, display all messages on the processed operation, specify the path of the synchronization script, and overwrite the existing synchronization script:
Summary
This article explains how to use the Row filter option in ApexSQL Data Diff and ApexSQL Data Diff for MySQL to limit the comparison in SQL Server to a specific subset of rows.