SQL Compare - 10.2
Using the Deployment wizard - SQL Compare
When you have selected the objects that you want to include in the deployment, use the Deployment wizard to create the deployment script.
To open the Deployment Wizard, click
Deployment Wizard
There are five possible steps in the wizard:
- Choose deployment method
Create and save a script, perform the deployment from SQL Compare, or update a scripts folder.
- Configure Backup (optional step)
If, on the first page of the wizard, you selected the option to back up before deploying, this additional step is shown. If you do not choose to back up, this step is not part of the wizard.
- Review migration scripts
View a list of migration scripts you can select to include in the deployment.
- Review dependencies
View a list of any objects that reference or are referenced by those you have chosen to deploy. You can choose to deploy these objects.
- Review deployment script
View the deployment script, review a summary of the deployment actions, and see information about any warnings.
Deploying backups
When you have selected a backup as the target, the deployment wizard creates a script to update the database from which the backup was created. Backups cannot be modified directly.
When a backup is the source, and a database is the target, the deployment script will synchronize the database with the backup.
For more information, see: Working with backups.
Deploying snapshots
When a SQL Compare snapshot is the target, deployment creates a script to update the database from which the snapshot was created. Snapshots cannot be modified directly.
When a snapshot is the source, and a database is the target, the deployment script will synchronize the database with the snapshot.
This is useful, for example, if you want to roll back changes. If you have made changes to a database, and created a snapshot before deployment, you can then set the snapshot as the source, and the database as the target, to roll back the changes.
For more information, see: Working with snapshots.
Deploying scripts folders
When a scripts folder is the target, you can either:
- Create a deployment script to update the database from which the scripts folder was created, or
- Update files in the scripts folder directly
Note that when an object is dropped during deployment, its script file is not deleted.
If a scripts folder is the target, and any of the script files that will be modified are designated as read-only, a warning is displayed. If you click Yes to continue, these files will be made writable so that they can be modified. This may occur, for example, when you are working with a source control system that sets files to read-only status in some situations.
For more information, see: Working with scripts folders.
Additional information
Note that if SQL Compare is unable to deploy the data sources, an error message is displayed, and where possible all changes are rolled back. However, if you have selected the project option Do not use transactions in deployment SQL scripts, the changes are not rolled back.
1. Choose deployment method
On the first page of the Deployment wizard you can choose to create and save a deployment script, perform the deployment using SQL Compare, or update a scripts folder:
Create a deployment script

If you choose to create a deployment script, on the Review page you can save a copy of the script or open it in your SQL editor.
To change the application you use to open the script, click Change. The Application Options dialog box is displayed, and you can specify the default application used to edit SQL Scripts.
Deploy using SQL Compare

If you choose to deploy using SQL Compare, on the Review page you can save a copy of the script and exit the wizard, or click Deploy Now to perform the deployment.
If the target is a scripts folder, this option is instead replaced by Update the scripts folder, and the SQL script files in the target are modified when you deploy.
If you select Back up target before deployment, a step is added to the Deployment wizard allowing you to specify details of the backup.
Note that if the target is a backup or a snapshot, the option to deploy using SQL Compare is not available. Instead, deployment creates a script to modify the data source form which the snapshot or backup was created.
2. Configure backup (optional step)
If you selected the option to back up before deployment, the Configure backup page is added to the Deployment wizard.
This page allows you to create a SQL Compare schema snapshot, or a full backup. You can use either Red Gate SQL Backup, or native SQL Server to perform the backup.
If the target is a scripts folder, you cannot perform a full backup before deployment. You can only create a snapshot from a scripts folder.
Create a SQL Compare snapshot

A SQL Compare schema snapshot is a binary file containing information about the structure of a database; it does not contain any table data.
This is useful, for example, if you want to roll back changes.
For more information, see: Working with snapshots.
Perform a full backup

When the target is a database, you can perform a full backup. In the Back up using box , select:
- Native SQL Server to create a backup using the native SQL Server BACKUP command
- Red Gate SQL Backup to create a backup using SQL Backup version 4 or later
Note that to use Red Gate SQL Backup, you must have the SQL Backup server components installed on the SQL Server instance of the target database.
For more information, see: Backing up before deployment.
3. Review migration scripts
If SQL Compare detects any migration scripts that apply to the deployment, the Review migration scripts page of the wizard is displayed:

Migration scripts are customizable change scripts that are committed to source control and re-used in deployment. For more information, see: Working with migration scripts.
You can select the migration scripts you want to include in the deployment using the check boxes.
Selecting overlapped migration scripts
By default, SQL Compare selects a migration script with a transition that covers the most versions. You must deselect this default selection before you can select any overlapped migration scripts.
4. Review dependencies
When you run the Deployment wizard, SQL Compare checks for dependencies:

All the objects you selected for deployment are listed. If they reference or are referenced by objects you did not select, and these dependencies affect the deployment, they are listed on this page.
For example, if a stored procedure references a table, and you do not include that table in the deployment, the table is listed here.
By default, SQL Compare includes these objects in the deployment. To exclude them, clear the Deploy all dependencies check box.
You are recommended to deploy all objects with dependencies. If you do not, objects may be left in an invalid state, or the deployment may fail.
5. Review deployment script

There are three tabs on the Review page:
- Deployment script shows the script to deploy the data sources.
You can search the script, save it, or copy it to the clipboard.
- Summary shows a synopsis of the actions in the deployment script.
You can view the summary grouped by the objects affected, by the type of modification, or by the order in which the script modifies the target.
- Warnings shows a list of any warnings about unexpected behavior that may occur when you deploy the databases.
For more information, see: Deployment warnings.
If you are updating or creating a scripts folder, the Files tab lists the object creation and data script files modified or created during deployment.
When you have reviewed the script, click Deploy Now to perform the deployment.
See also |
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