SQL Compare
Latest version: 10.0
Notes & articles
Release notes - version 9.5 EAP
Thank you for participating in the SQL Compare 9.5 early access program.
SQL Compare 9.5 is still in development. If you have any comments, requirements or suggested improvements, please let us know.
What's new in SQL Compare 9.5?
- Migration script support
- Table mapping
- Comparing versions from SQL Source Control
- New command line switches
- New project options
- Connecting to Denali servers
- Transaction Isolation Level application option
Migration script support
SQL Source Control 3.0 enables you to create migration scripts between two versions of a database. Migration scripts are customizable change scripts that are committed to source control and re-used in deployment.
This can be useful, for example, if you add a NOT NULL constraint to a column in development and want to deploy this change to your testing environment. If you try to deploy this change using SQL Compare, the synchronization script will fail because a default value is required; you can specify this value using a migration script.
For full details, see: SQL Source Control 3.0 early access release notes.
Table mapping
SQL Compare 9.5 allows you to map together tables and columns with different names. This can be useful to prevent data loss when synchronizing tables or columns that have been renamed.
For example, if you map the table TableA in the source to the same table that has been renamed as TableB in the target, SQL Compare will compare the table as an object that exists in both data sources. When you synchronize the table, the name change will be scripted using the sp_rename system stored procedure; the table is not dropped and re-created.
To compare tables and columns that are not automatically mapped, click the Table Mapping tab of the Project Configuration dialog box:

The upper pane displays tables that are fully Mapped or have Partial mapping. The lower pane displays Unmapped tables.
Note that:
- If a table has a Partial mapping, some of its columns are not mapped, and cannot be compared.
- To set the column mappings for a table, click the Status link for the object you want to re-map.
Comparing versions from SQL Source Control
In SQL Compare 9.5, you can select specific versions of a source-controlled database to compare.
To do this:
- On the Project configuration dialog box, select Database as a data source.
- Specify connection details for a database linked to SQL Source Control.
- In the Database box, under Source-Controlled Databases, select the database:

- Select the Use version from source control check box.
- In the Version box, select either the latest version, or a specific version to compare:

New command line switches
The following command line switches are new in SQL Compare 9.5:
/AbortOnWarnings
Alias: /aow
Specifies that SQL Compare will not perform a synchronization if there are any serious synchronization warnings.
If you use this switch and there are serious synchronization warnings, exit code 61 is displayed.
/IgnoreSourceCaseSensitivity
When you are creating a scripts folder using /makescripts, SQL Compare automatically detects the case sensitivity of the data source.
Use /ignoreSourceCaseSensitivity to disable automatic detection of case sensitivity.
/LogLevel:<level>
Alias: /log
Creates a log file with a specified minimum log level.
Log files collect information about the application while you are using it. These files are useful to us if you have encountered a problem. For more information, see: Logging and log files.
Arguments:
|
Disables logging |
|
Reports serious and fatal errors |
|
Reports warning and error messages |
|
Reports all messages in the log file |
The default is None.
For example:
sqlcompare /db1:WidgetStaging /MakeScripts: D:\Scripts Folder
/LogLevel:Verbose
Note: you must use /LogLevel each time you want a log file to be created.
/ShowWarnings
Alias: /warn
Displays any warnings that apply to the synchronization.
sqlcompare /db1:WidgetStaging /db2:WidgetProduction
/ShowWarnings
/Version1:<version1>
Alias: /v1
Specifies the source control version of the first (source) database. To specify a version, the database must be linked to SQL Source Control.
To specify the latest version, type: HEAD
The following example compares version 3 of WidgetStaging with the latest version of WidgetProduction:
sqlcompare /db1:WidgetStaging /version1:3
/db2:WidgetProduction /version2:HEAD
/Version2:<version2>
Alias: /v2
Specifies the source control version of the second (target) database. To specify a version, the database must be linked to SQL Source Control.
/VersionUserName1:<versionusername1>
Alias: /vu1
Specifies the username for the source control server linked to the first (source) database.
sqlcompare /db1:WidgetStaging /v1:3 /versionusername1:User1 /vp1:P@ssw0rd
/db2:WidgetProduction /v2:HEAD /versionusername2:User2 /vp2:Pa$$w0rd
If you have a username saved in SQL Source Control, you do not need to specify it in the command line.
/VersionUserName2:<versionusername2>
Alias: /vu2
Specifies the username for the source control server linked to the second (target) database.
/VersionPassword1:<versionpassword1>
Alias: /vp1
Specifies the password for the source control server linked to the first (source) database.
sqlcompare /db1:WidgetStaging /v1:3 /vu1:User1 /versionpassword1:P@ssw0rd
/db2:WidgetProduction /v2:HEAD /vu2:User2 /versionpassword2:Pa$$w0rd
If you have a password saved in SQL Source Control, you do not need to specify it in the command line.
/VersionPassword2:<versionpassword2>
Alias: /vp2
Specifies the password for the source control server linked to the second (target) database.
New project options
The following project options are new in SQL Compare 9.5:
Add object existence checks
When this option is selected, SQL Compare checks for the existence of objects affected by the deployment by adding IF EXISTS statements in the deployment script.
This option can be useful, for example, if you want to run the deployment script multiple times.
Use DROP and CREATE instead of ALTER
When this option is selected, SQL Compare replaces ALTER statements in the deployment script with DROP and CREATE statements for the following objects:
- Views
- Stored Procedures
- Functions
- Extended Properties
- DDL Triggers
- DML Triggers
Note that if you select this option, you must also select the Add object existence checks option, or the deployment script will fail.
Connecting to Denali servers
SQL Compare 9.5 enables you to connect to SQL Server Denali servers.
If you have any feedback on which new Denali features you want SQL Compare to support, let us know.
Transaction Isolation Level application option
SQL Compare 9.5 includes a new option enabling you to set the transaction isolation level used in synchronization scripts. You can use this option to prevent synchronization errors when using linked servers.
To set the transaction isolation level:
- In the SQL Compare Tools menu, click Application Options.
- Under Synchronization scripts, click the Transaction Isolation Level box, and then select the level you want to set:

Was this article helpful?
SQL Compare
- Logging and log files
- Stored Procedures and Functions created with wrong name
- Synchronization scripts may be in incorrect version of SQL syntax
- Extended properties not permitted error (version 5.2)
- CLR Procedures' permissions are not recreated (version 5)
- Support for 'returns NULL on NULL Input' in CLR functions (version 5)
- Project files (scp files) suddenly appear on desktop (version 5)
- Stored procedures using full-text queries fail to synchronize
- When does the synchronization process rebuild tables?
- Unable to begin a distributed transaction error synchronizing databases
- User or role already exists in the current database error
- Clarification on the "Ignore Triggers" option in the SQL Compare command-line version
- Common table expressions returned by User Defined Functions may fail
- Can't compare encrypted text in SQL Server 2005, 2008
- Exception when connecting to SQL Server (Version 6)
- SQL comparison and synchronization automation capabilities
- Error logging in SQL Compare 6.2
- Using Team Foundation Server source control system
- Creating a SQL 2000 compatible database from a SQL 2005 database using SQL Compare
- Support for numbered stored procedures
- SQL Compare 7 Object-level restore
- Index was outside the bounds of the array error when registering databases X64
- HTML reports are generated for identical comparisons
- Comparison may seem slower than necessary
- DEFAULT_SCHEMA clause cannot be used with a Windows group
- SQL Compare may drop and create CLR assemblies
- SDK activation prompt may appear when starting a new SQL Compare project
- Column does not allow nulls. INSERT fails
- This SQL Server has been optimized for x concurrent queries.
- SQL Compare comparison differences
- Using SQL Server Management Studio Express as a query editor
- How to force SQL Compare and SQL Data Compare to use an Encrypted Connection
- Invalid SQL when synchronizing an index to a scripts folder when data compression is specified
- Tips
- Changes to distribution of command line
- Common error messages
- Copying the structure of a database
- Permissions required to use SQL Compare
- Rollback on script failure or cancellation
- Errors in scripts folders
- Logging and log files
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 Compare
- Activating your products
- Activating your products
- Getting help offline
- Release notes - version 9.5 EAP
- Introducing SQL Compare 8: FAQs for SQL Compare 7 users
- Release notes - version 10.xx
- SQL Compare release notes - version 9.xx
all SQL products
all products
- Red Gate product acknowledgements
- Activating your products
- 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
- 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

Using SQL Compare