SQL Data Compare 10

Changes to the command line in SQL Data Compare 8

These changes coincide with the release of SQL Compare 8, and are intended to make command line syntax more consistent between SQL Compare and SQL Data Compare.

In SQL Data Compare 8, there are changes to the names and functions of some command line switches and options, as well as their aliases.

  • The command line syntax of previous versions of SQL Data Compare is considered deprecated, but continues to be supported. For example, in SQL Data Compare 7, the alias for /BackupSet1 was /bs1. In SQL Data Compare 8, the alias is now /bks1. You can continue to use /bs1 in SQL Data Compare 8, but a message is displayed informing you of the new alias.

Deprecated command line syntax will cease to be supported at a future release.

This page addresses the following:

Which switches have changed?

/AllowIdenticalDatabases

This switch is deprecated. Instead use /Include:Identical

/BackupSet1 and /BackupSet2

The aliases for these switches are now /bks1 and /bks2.

The functionality of these switches has not changed.

/CaseSensitive

This switch is deprecated. Instead use  /Options:CaseSensitiveObjectDefinition

/Columns

This switch is deprecated. Instead use /IncludeColumns and /ExcludeColumns

/ExportIdenticalTables

This switch is deprecated. Instead use  /Include:Identical

/IgnoreParserErrors

If SQL Data Compare encounters any high level errors when parsing a scripts folder, it will exit with an error code of 62.

Use /ignoreParserErrors to force SQL Data Compare to continue without exiting.

/Include and /Exclude

Specify which tables and views are included in the comparison.

/Include and /Exclude have the following arguments:

  • Additional: only those objects that are not present in the source (eg /db1)
  • Missing: only those objects that are not present in the target (eg /db2)
  • Different: only those objects that are present in both data sources, but are different.
  • Identical: identical objects in the command line output and any generated reports.
  • User specified: objects you specify with a regular expression (eg /Include:Table:WidgetPurchases)

Note that if there is a conflict, /Exclude takes precedence over /Include

/IncludeColumns and /ExcludeColumns

Specifies which columns in a table are included in or excluded from the comparison.

Note that /ExcludeColumns takes precedence over /IncludeColumns

/IncludeAdditional

This switch is deprecated. Instead use /Include:Additional

/ScriptFile

Alias: /sf

Generates a SQL script to migrate the changes which can be executed at a later time. If the file already exists an error will occur, unless you use the /Force switch:

 

sqldatacompare /db1:WidgetStaging /db2:WidgetProduction
     /ScriptFile: "C:\Scripts Folder\WidgetSyncScript.sql"

/Scriptfile can be used when the target (/db2, /scr2, /sn2) is a database, a snapshot, or a scripts folder.

If the target is a snapshot or a scripts folder, the generated script modifies a database with the schema represented by that snapshot or scripts folder.

Which options have changed?

DDLTriggerDisable

This option has been renamed: DisableAndReenableDDLTriggers, with the alias drd

DisableDMLTriggers

This option has been renamed: DisableAndReenableDMLTriggers, with the alias t

ForceCheck

New option. Forces any constraints (for example, those on foreign keys) disabled by SQL Data Compare to be re-enabled with CHECK.

IgnoreCase

This option is deprecated. Case insensitive comparison is now the default behavior.

Changes to case sensitivity behavior

In earlier versions of SQL Data Compare the case sensitivity behavior of the command line interface was inconsistent.

/CaseSensitive affected the matching of object names for the /Include, /Exclude, /Columns, and /ComparisonKeys switches. The option IgnoreCase was on by default, and affected the case sensitivity of object and owner mapping.

These behaviors are now deprecated, and all switches and mappings share the same case sensitivity behavior.

In SQL Data Compare 8:

  • the default setting is case insensitive
  • case sensitivity is set using /Options:CaseSensitiveObjectDefinition

Compatibility with earlier versions

Although the command line syntax of previous versions of SQL Data Compare is considered deprecated, it continues to be supported.

If you use deprecated syntax, a warning is displayed, but SQL Data Compare functions normally.

Note that for case sensitivity, the new syntax takes precedence. For example, if you set both /Options:CaseSensitiveObjectDefinition and /Options:IgnoreCase, the command line behavior is case sensitive.

You are recommended to use the new syntax. Deprecated command line syntax will cease to be supported at a future release.


Didn't find what you were looking for?