SQL Compare 11

Setting project options

You can use project options to modify the behavior of SQL Compare. For example, you can set SQL Compare to ignore certain objects even if they're different, or so it doesn't script certain properties for deployment (such as the collation order on columns).

When you create a new project, you should run the comparison with the default options, then review your comparison results. However, if your database is on a SQL Server with case-sensitive sort order, you must select the Use case sensitive object definition option. When you have reviewed your comparison results, you may want to consider changing some of the options.

The options you set are saved for each project, and are modified on the Project Configuration dialog box.
To display the Project Configuration dialog box, click  (Edit Project), or select Project Options from the Tools menu.

Some of the options apply only to the comparison, and don't affect the deployment. Similarly, some options apply only to the deployment.

Default options

To make the current selection of options your defaults, click Save As My Defaults. These saved defaults will be used for all new projects. To restore your defaults after making changes, click My Defaults.

To reset all the options to their original settings, click Red Gate Defaults. The default options for a project are as follows:

  • Decrypt encrypted objects on 2005 and 2008 databases
  • Ignore white space
  • Ignore fill factor and index padding
  • Ignore filegroups, partition schemes, and partition functions
  • Ignore user properties
  • Ignore WITH element order
  • Ignore database and server names in synonyms

To search for an option, type search text in the Find box. The list is filtered to display only those options that contain the search text.

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
If you select this option, you must also select the Add object existence checks option, or the deployment script will fail.

Enable fast deployment

This option allows you to deploy a database from the Project Configuration dialog box, bypassing the comparison results and deployment wizard.

When this option is selected, click the Deploy Now button to deploy a database.

By default, all objects are deployed. If you want to select objects to deploy, you must run the comparison, select the objects, and then save the project.

Use case sensitive object definition

For databases with case-sensitive collation, enables objects with case-sensitive names to be compared and deployed. For example, considers object names such as ATable and atable as different and performs case-sensitive comparisons on stored procedures, and so on.

You should use this option only if you have databases with binary or case-sensitive sort order.

Be careful when you change this option. For example, if you create a database snapshot with this option selected and you then compare the snapshot with another database with the option cleared, SQL Compare may produce unexpected errors.

Use database compatibility level

Uses a database's compatibility level instead of the SQL Server version.

Force column order

If additional columns are inserted into the middle of a table, this option forces a rebuild of the table so the column order is correct following deployment. Data will be preserved.

Do not use transactions in deployment scripts

Removes transactions from the deployment script to produce SQL code that is more readable.

If this option isn't selected and the deployment script fails, the script is rolled back to the start of the failed transaction. If this option is selected, the script is isn't rolled back. This can be useful for detection of errors within a script.

If the deployment includes memory-optimized objects (memory-optimized tables, natively compiled stored procedures or memory-optimized table types), you must select this option to create a valid deployment script.

For more information, see Deploying memory-optimized objects.

Do not add error handling statements to deployment scripts

Removes error handling statements from the deployment script to produce SQL code that is more readable.

If you run the script and this option is not selected, the script will stop executing after encountering an error. This can be useful if you want to continue running the script when there are errors.

If you deploy using SQL Compare, the deployment is always stopped when an error is encountered.

This option can only be selected if the Do not use transactions in deployment scripts option is selected.

Add WITH ENCRYPTION

Adds WITH ENCRYPTION when stored procedures, functions, views, and triggers are included in the deployment.

When SQL Compare creates a snapshot, this option is ignored, and WITH ENCRYPTION isn't saved in the snapshot.

If you use ADD ENCRYPTION on a SQL Server 2005 database, SQL Compare won't be able to display, compare, or deploy the encrypted objects.

Do not use ALTER ASSEMBLY to change CLR objects

This option isn't used for SQL Server 2000 databases.

If CLR objects are to be deployed, this option forces two rebuilds of the table with conversion to and from strings to update the CLR objects, instead of using ALTER ASSEMBLY. For a detailed explanation, see Understanding the deployment.

This option affects the deployment only.

Consider next filegroups in partition schemes

This option isn't used for SQL Server 2000 databases.

When this option is selected, if a partition scheme contains a next filegroup, SQL Compare considers the next filegroup in the comparison and deployment if the partition scheme is extended. The next filegroup doesn't affect how data is stored.

To ignore next filegroups, clear the check box.

Disable DDL triggers during deployment

This option isn't used for SQL Server 2000 databases.

DDL triggers can cause problems when you run the deployment. Select this option to disable any enabled DDL triggers before deploying the databases, and re-enable those triggers following deployment.

Don't include a comment header in the deployment script

When this option is set, the comment header isn't included in the deployment script.

Add database USE statement

Adds a database USE statement to the top of the deployment script.

This option affects the deployment only.

Decrypt encrypted objects

This option isn't used for SQL Server 2000 databases.

When this option is selected, SQL Compare will decrypt encrypted database objects.

When SQL Compare saves a snapshot or scripts folder, this option is set and all encrypted objects are decrypted.

When comparing large databases, selecting this option can result in slower performance.

Ignore migration scripts for databases

When this option is selected, SQL Compare won't try to retrieve migration scripts when you compare a database.

By default, when you compare a database that has an associated revision number, SQL Compare tries to connect to source control to retrieve any relevant migration scripts.

This option can be useful if you've encountered an error connecting to source control when comparing a database.

Use migration scripts V2 (beta) instead of V1

Enables the Migrations V2 beta. V1 migration scripts will be ignored.

For more information, see Migration scripts V2 beta in the SQL Source Control documentation.

Database project compatible script folder output

This option forces script folder output to conform to the style used by the most recent Visual Studio database project type.

Ignore indexes

Ignores indexes when comparing and deploying databases.

Ignore permissions

Ignores permissions on objects when comparing and deploying databases.

Ignore DML triggers

Ignores DML triggers when comparing and deploying databases.

Ignore constraint and index names

Ignores the names of indexes, foreign keys, primary keys, and default, unique, and check constraints when comparing databases. The names won't be ignored when the databases are deployed.

Ignore system named constraint and index names

Ignores the names of system named indexes, statistics, foreign keys, primary keys, and default, unique, and check constraints when comparing and deploying databases.

Ignore whitespace

Ignores white space (newlines, tabs, spaces, and so on) when comparing databases. White space won't be ignored when the databases are deployed.

Ignore comments

Ignores comments when comparing views, stored procedures, and so on.

Comments won't be ignored when the objects are deployed.

Ignore full-text indexing

Ignores full-text catalogs and full-text indexes when comparing and deploying databases.

Ignore users' permissions and role memberships

When role-based security is used, object permissions are assigned to roles, not users. If this option is selected, SQL Compare compares and deploys object permissions only for roles, and members of roles that are roles. Users' permissions and role memberships are ignored.

Ignore statistics

Ignores statistics when comparing and deploying databases.

Ignore foreign keys

Ignores foreign keys when comparing and deploying databases.

Ignore check constraints

Ignores check constraints when comparing and deploying databases.

Ignore identity seed and increment values

For identity properties, ignores only the identity seed and increment values when comparing databases. They won't be ignored when the databases are deployed.

Ignore fill factor and index padding

Ignores the fill factor and index padding in indexes and primary keys when comparing and deploying databases.

Ignore INSTEAD OF triggers

Ignores INSTEAD OF DML triggers when comparing and deploying databases.

Ignore bindings

Ignores bindings on columns and user-defined types when comparing and deploying databases. For example, sp_bindrule and sp_bindefault clauses will be ignored.

Ignore WITH NOCHECK

Ignores the WITH NOCHECK argument on foreign keys and check constraints.

Foreign keys or constraints that are disabled aren't ignored.

Ignore filegroups, partition schemes, and partition functions

Ignores filegroup clauses, partition schemes, and partition functions on tables and keys when comparing and deploying databases. Partition schemes and partition functions aren't displayed in the comparison results.

Ignore extended properties

Ignores extended properties on objects and databases when comparing and deploying databases.

Ignore SET QUOTED_IDENTIFIER and SET ANSI_NULLS statements

Ignores these SET statements when comparing views, stored procedures, and so on. These statements won't be ignored when the databases are deployed.

Ignore collations

Ignores collations on character data type columns when comparing and deploying databases.

Ignore certificates, symmetric keys, and asymmetric keys

This option is used only for SQL Server 2008 and SQL Server 2005 databases.

SQL Server severely restricts access to certificates, symmetric keys, and asymmetric keys. Consequently, SQL Compare can't compare all of the properties for a symmetric key.

If certificates, symmetric keys, and asymmetric keys are selected for deployment, only the permissions are deployed.

Ignore DML trigger order

DML triggers can have an order specified, such as FIRST INSERT, LAST UPDATE, and so on. Select this option to ignore the trigger order for DML triggers when comparing and deploying databases. The DDL trigger order isn't affected.

Ignore event notification on queues

This option is used only for SQL Server 2008 and SQL Server 2005 databases.

Ignores the event notification on queues when comparing and deploying databases.

Ignore user properties

This option is used only for SQL Server 2008 and SQL Server 2005 databases.

If this option isn't selected, SQL Compare compares user properties, such as the type of user (SQL, Windows, certificate-based, asymmetric key based) and any schema. If a user is selected for deployment, SQL Compare deploys the properties where possible.

If you select this option, users' properties are ignored, and only the user name is compared and deployed.

Ignore WITH element order

If a stored procedure, user-defined function, DDL trigger, DML trigger, or view contains multiple WITH elements (such as encryption, schema binding, and so on), select this option to ignore the order of the WITH elements when comparing and deploying databases.

Ignore LOCK properties of indexes

This option is used only for SQL Server 2008 and SQL Server 2005 databases.

Ignores index PAGE LOCK and ROW LOCK properties when comparing and deploying databases.

Ignore replication triggers

Ignores replication triggers when comparing and deploying databases.

Ignore NOT FOR REPLICATION

Ignores the NOT FOR REPLICATION option on foreign keys, identities, check constraints and triggers.

If you select this option, the NOT FOR REPLICATION statement won't be displayed in the object creation script for foreign keys, identities, and check constraints.

In the case of triggers, the NOT FOR REPLICATION statement will be displayed in the object creation script, but will be ignored for the purposes of the comparison. When comparing triggers, you should also select the Ignore white space option, but this option will also be applied to all objects in the comparison.

Check constraints and foreign keys that contain the NOT FOR REPLICATION statement in their definition will automatically be flagged as WITH NOCHECK. Use the Ignore WITH NOCHECK option to identify these objects as being the same; but this will apply to constraints in all objects.

Ignore identity property on columns

Ignores the identity property on columns when comparing databases. The identity property won't be ignored when databases are deployed.

Ignore data compression

This option is used only for SQL Server 2008 databases.

Ignores page and row compression for tables and indexes. When Ignore filegroups is selected, compression is automatically ignored for partitioned tables.

Ignore database name and server name in synonyms

Ignores database names in synonyms when comparing databases.

Ignore owner authorization on schema objects

This option is used only for SQL Server 2008 and 2005 databases.

Ignores authorization clauses on schema-qualified objects when comparing and deploying databases.

Ignore STATISTICS_NORECOMPUTE property on indexes

Ignores the STATISTICS_NORECOMPUTE property on indexes and primary keys.

Ignore square brackets in object names

Ignores starting and ending square brackets in object names which have been escaped using square brackets. This applies to textual objects such as stored procedures, triggers, etc.

Ignore tSQLt framework and tests

Ignores the tSQLt schema and its contents, the tSQLtCLR assembly, the SQLCop schema and its contents, and any schemas and their contents with the tSQLt.TestClass extended property set.

Ignore encryption of object text

Ignores WITH ENCRYPTION statements on triggers, views, stored procedures and functions.

This option overrides Add WITH ENCRYPTION.


Didn't find what you were looking for?