SQL Data Compare
Latest version: 10.0
Knowledge base
Improving the performance of SQL Data Compare
SQL Data Compare can take a long time to compare and synchronize data sources. The speed of the comparison depends mostly on disk write speed, processor speed, memory, and the size of the databases.
When you run a comparison, SQL Data Compare retrieves the data from the two data sources and copies it to a temporary location on your local machine. If the SQL Servers are remote, the data is copied across the network to your local machine.
Although there is no limit on the size of the data sources that you can compare, the amount of available disk space restricts the amount of data that can be compared. You need roughly twice the size of the database for the comparison and up to four times the size of the database to generate the synchronization SQL.
To speed up the comparison, and avoid running out of disk space, you can:
- change the location of the temporary files
- filter the comparison at table-level, column-level, or row-level
- review the options for comparison behavior
Changing the location of the temporary files
SQL Data Compare uses temporary files when it compares the databases. To avoid running out of disk space, you can change the location of these files.
The location of the temporary files is defined by the RGTEMP environment variable, or the TMP variable if RGTEMP does not exist (see your Windows® documentation for information about environment variables).
You are not recommended to edit the TMP variable, as this will affect all programs that use the variable. Instead, you can create a new environment variable called RGTEMP, and specify the required location, such as a different hard disk with more free space. The RGTEMP variable affects only Red Gate programs.
Note that you may need to log out of Windows® for the change to take effect.
Filtering the comparison
By default, SQL Data Compare selects all tables, all columns, and all rows for comparison. This means all the data that differs in both data sources is stored temporarily. By filtering the data, you compare only the data you are really interested in, and the size of the temporary files is reduced.
You filter data using the Tables & Views tab on the Project Configuration dialog box. The filtering techniques described here are useful when your tables contain a large amount of data that differs:
Table filtering
To exclude all the data in a table, on the Tables & Views tab of the Project Configuration dialog box, clear its check box:
The table will not be compared.
Column filtering (vertical filtering)
To exclude all the data in particular columns, click in the Columns in Comparison box for the associated table, and then clear the check boxes for the required columns:
Only the selected columns will be compared.
Row filtering (horizontal filtering)
To exclude specific rows, click WHERE Clause, and then type a T-SQL WHERE clause in the box:
You can apply the same WHERE clause to multiple tables, by highlighting the required tables before opening the WHERE Clause Editor.
You can apply a different WHERE clause for each data source by clearing the Use the same WHERE clause for both data sources check box.
Note that you can only filter rows if the data source is a database. WHERE clauses are not available for backups and scripts folders.
Reviewing the options for comparison behavior
By default, SQL Data Compare includes identical values in the comparison results. If your data sources always contain similar data, on the Options tab of the Project Configuration dialog box, clear the Show identical values in results check box.
When you do this, SQL Data Compare does not store data that is identical, reducing the disk space that is required.
If you are comparing tables with large amounts of data that changes infrequently, select the Use checksum comparison check box. You must clear the Show identical values in results check box before you do this. If the checksums are equal, SQL Data Compare does not compare that table, and its data is not stored, reducing the disk space that is required.
Note that if your table contains large data types such as text or images, these columns are not included in the checksum, and you are not recommended to use the Use checksum comparison option.
Was this article helpful?
SQL Data Compare
- Logging and log files
- Internal Connection Fatal Error in versions 4 and 5
- NULL textptr passed to UPDATETEXT function when running synchronization
- How much free hard disk space is required?
- Comparing the data of two tables in the same database
- Suggestions to combat comparison and synchronization performance issues
- SQL comparison and synchronization automation capabilities
- SqlNullValueException occurring in synchronization wizard
- SQL Data Compare command-line XML argument file examples
- Using Windows authentication logons between domains
- Using a filter on a column on related (joined) tables
- Determining minimum database permissions for SQL Data Compare
- Tables with compound keys may not be mapped automatically
- Best practices for synchronizing data
- Cleaning up a SQL script after SQL Compare or SQL Data Compare
- Troubleshooting System.OutOfMemoryException during comparison
- Exception thrown by db reader 1
- Reseed applying "incorrect" identity values
- Running migration scripts using SqlCmd.exe
- This SQL Server has been optimized for x concurrent queries.
- SQL Data Compare showing differences in 2 identical databases
- How to force SQL Compare and SQL Data Compare to use an Encrypted Connection
- Improving the performance of SQL Data Compare
- Logging and log files
- Case-sensitive comparisons
- Tables or views that could not be compared
all SQL products
- Compatibility of Red Gate tools in 64-bit environments
- Application has encountered an error and needs to close
- Error message after installing SQL Toolbelt - The description for Event ID ( 1 ) in Source ( nview_info ) cannot be found.
- Changing the temporary directory used by the installer
- Toolbelt Installer "hanging" while "scanning volumes"
- Login failing with "trusted SQL Server connection" error when using RunAs
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
SQL Data Compare
- Activating your products
- Getting help offline
- Getting better performance out of SQL Data Compare
- Release notes - version 10.xx
- SQL Data Compare release notes - version 7.xx
- SQL Data Compare release notes - version 8xx
- SQL Data Compare release notes - version 9.xx
all SQL products
all products
- Red Gate product acknowledgements
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs
- Installing Red Gate SQL Server tools across a network





Using SQL Data Compare