Command-line options

By default, dbForge Data Compare for SQL Server generates a file with command-line arguments and records all comparison and synchronization options into it. Each option is displayed in the format:

/option_name:[Y/N]

You can edit the file to turn on/off the required options. To turn on comparison and synchronization options, set their values to “Yes”, “Y”, “True”, “T”, or “On”. To turn off the options, use “No”, “N”, “False”, “F”, or “Off”.

Each option has both a full name and a short name. Instead of editing the file, you can specify the desired option directly in the Command Prompt.

See below the list of options with their full and short command line names.

Comparison and synchronization options

The table provides comparison and synchronization options with their full and short command-line names.

Full name Short name Description
AddBackupType addbt Creates a backup in the selected mode.
Note:
  • Creating a differential backup requires a previous full database backup.
  • The copy-only mode is available for Microsoft SQL Server 2008 and later.
AddingErrorHandling adderrorhandle Stops script execution if an error occurs.
AddTransactionIsolationLevel addtransiso Sets a transaction isolation level to the selected value. You can specify the following transaction isolation levels: SERIALIZABLE, SNAPSHOT, REPEATABLE READ, READ COMMITTED, and READ UNCOMMITTED.
BackupExtension extbackup Applies a specified file extension to backups. The default extension is .bak.
BulkInsert bi Uses multi-row INSERT statements to improve data insertion performance and increase the batch size limit.
CheckConcurrencyUpdates concupd Prevents accidental data overwrites by adding non-key conditions to the WHERE clause of UPDATE and DELETE statements, and by using IF NOT EXISTS checks before INSERT statements.
CheckDifferent chkdiff Includes different records in comparison results. The records can then be selected for synchronization.
CheckIdentical chkequal Includes identical records in comparison results.
CheckOnlyInSource chksource Includes only source records in comparison results. The records can then be selected for synchronization.
CheckOnlyInTarget chktarget Includes only target records in comparison results. The records can then be selected for synchronization.
CompareClrTypesAsBinary clrasbin Compares and synchronizes CLR types as binary, otherwise as a string. The option is useful for large CLR data.
Note: The option is not applicable to types that do not implement IComparable.
CompareColumnStoreTables colstore Compares tables with COLUMNSTORE indexes.
CompareMemoryOptimizedTables moptimize Compares memory-optimized tables.
CompareTables tables Compares tables and includes them in comparison results.
CompareTemporalHistoryTable history Compares and synchronizes history tables for temporal tables.
CompareViews views Compares views and includes them in comparison results. To synchronize the views, ensure they don’t contain IDENTITY or computed columns.
CreateBackupFolder cbackupfolder Creates a folder for the database backup.
DeployDatabaseInSingleUserMode depsingl Synchronizes a database in a single-user mode. The option is supported only for Microsoft SQL Server and Azure SQL Managed Instance.
DisableDdlTriggers noddl Disables DDL triggers at the beginning of synchronization and re-enables them after synchronization completes.
DisableDmlTriggers nodml Disables DML triggers at the beginning of synchronization and re-enables them after synchronization completes. The option applies to tables and views.
DisableForeignKeys nofk Drops foreign keys at the beginning of synchronization and restores them after synchronization completes.
DropCheckConstraints dropcheck Drops the CHECK and NOT NULL constraints at the beginning of synchronization and restores them using the WITH NOCHECK option after synchronization completes.
DropKeys dropkeys Drops primary keys, indexes, and unique constraints at the beginning of synchronization and restores them after synchronization completes.
Note: Primary keys, indexes, and unique constraints used as comparison keys aren’t dropped.
ExcludeComments nocomments Excludes comments from a synchronization script.
ExcludeNewAddedObjects excnewaddedobj Compares only tables and views explicitly included in the saved project (.dcomp).
ExcludeObjectsByMask meobjmask Excludes tables or views from comparison based on a custom wildcard or regular expression.
ExecuteAsSingleTransaction tran Executes a synchronization script in a single transaction. If an error occurs during execution, all database changes are rolled back.
FileStoragePath fspath Generates a separate file for the OPENROWSET function when a value exceeds 1 MB. To upload files to a remote server, a shared network folder accessible to both the client and server is required. The option applies to (N)TEXT, XML, VARBINARY(MAX), (N)VARCHAR(MAX), IMAGE, and CLR.
IgnoreCase icase Ignores the case of (N)CHAR, (N)VARCHAR, (N)VARCHAR(MAX), (N)TEXT, and CLR. The option doesn’t affect key comparison columns and applies only to values up to 5 MB.
IgnoreColumnsByMask micolmask Excludes columns from comparison based on a custom wildcard or regular expression.
IgnoreComputedColumns micomput Excludes computed columns from comparison.
IgnoreEndOfLine ieol Ignores all carriage return and line feed characters during comparison. The option applies to (N)CHAR, (N)VARCHAR, (N)VARCHAR(MAX), and (N)TEXT columns. It doesn’t affect key comparison columns.
Note: Using the option with (N)TEXT may slow down comparison.
IgnoreIdentityColumns miident Ignores IDENTITY columns during comparison.
IgnoreInternalSpaces iispaces Ignores spaces, tabs, and other non-printable characters inside a string during comparison. The option applies to (N)CHAR, (N)VARCHAR, (N)VARCHAR(MAX), and (N)TEXT columns. It doesn’t affect key comparison columns.
Note: Using the option with (N)TEXT may slow down comparison.
IgnoreLeadingSpaces ilspaces Ignores leading spaces, tabs, and other non-printable characters in a string during comparison. The option applies to (N)CHAR, (N)VARCHAR, (N)VARCHAR(MAX), and (N)TEXT columns. It doesn’t affect key comparison columns.
Note: Using the option with TEXT may slow down comparison.
IgnoreLobColumns milob Ignores LOB columns during comparison. The option applies to IMAGE, (N)TEXT, (N)VARCHAR(MAX), VARBINARY(MAX), and XML.
IgnoreRowguidColumns mirowguid Ignores ROWGUID columns during comparison.
IgnoreTemporalTableSysColumns isyscol Ignores SYSTEM_TIME period columns in temporal tables during comparison and synchronization.
IgnoreTimestampColumns mitime Ignores TIMESTAMP columns during comparison.
IgnoreTrailingSpaces itspaces Ignores trailing spaces, tabs, and other non-printable characters in a string during comparison. The option applies to (N)CHAR, (N)VARCHAR, (N)VARCHAR(MAX), and (N)TEXT columns. It doesn’t affect key comparison columns.
Note: Using the option with (N)TEXT may slow down comparison.
IgnoreWhiteSpace ispaces Ignores whitespace characters during comparison of views, triggers, stored procedures, and functions. Original whitespaces in script object bodies are preserved during synchronization.
IncludeObjectsByMask miobjmask Compares only tables or views that match a specified wildcard or regular expression mask.
IncludePrintComments iprint Displays comments explaining synchronization actions during script execution.
IncludeUseDatabase inud Adds a USE <database> statement to a synchronization script.
IsEmptyStringEqualsNull emptyeqnull Treats NULL and EMPTY STRING as the same value.
IsIgnoreTime itime Ignores the time component of DATETIME values during comparison. The option applies to DATETIME, DATETIME2, DATETIMEOFFSET, and SMALLDATETIME.
MappingIgnoreCase micase Ignores lower and upper case differences in object names when mapping them.
MappingIgnoreSpaces mispace Ignores spaces in object names when mapping them.
MappingIgnoreUnderscores miunder Ignores underscores in object names when mapping them.
NeedCompressBackup comprbackup Creates a compressed backup. This option is available for Microsoft SQL Server 2008 or later.
ReseedIdentityColumns reseed Reseeds the current value for IDENTITY columns.
RestoreConstraintsWithCheck checkconstrrestore Restores constraints using the WITH CHECK parameter. By default, constraints are created in the fast mode without validation.
RoundFloatTypes round Rounds float types up to 3 digits. The option applies to NUMERIC, DECIMAL, SMALLMONEY, MONEY, FLOAT, and REAL. It doesn’t affect key columns.
ToleranceInterval tol Specifies the maximum allowed difference (absolute value) between source and target values. If the difference doesn’t exceed this value, the values are considered equal. The option applies to BIGINT, NUMERIC, SMALLINT, DECIMAL, SMALLMONEY, INT, TINYINT, MONEY, FLOAT, and REAL data types. It doesn’t affect key columns.
UseSchemaNamePrefix fullnames Generates fully qualified object names, including schema names, in a synchronization script.

Comparison and synchronization report options

Full name Short name Description
AppendTimestampReport tsreport Adds a timestamp to the folder name of a generated comparison report.
DifferentPerColumns diffpercolumns Displays the number of differences per column.
HideUnmodifiedColumns hidecolumns Excludes columns with no differences.
IncludeComparisonSettings incsettings Includes comparison and synchronization settings.
IncludeObjectsData incdata Includes object data.
IncludeSyncWarnings incwarnings Includes comparison or synchronization warnings in the report, if any.

Usage examples

  • Compare data using settings from a file saved earlier:
/datacompare /compfile:"D:\workDir\SC1vsSC2.dcomp"
  • Compare and synchronize data using the connection through the client. Log will be written to the specified file:
/datacompare /source server:SqlServer1 user:sa password:psw database:db1 /target server:SqlServer2 user:sa password:pswd database:db2 /sync /log:"D:\sync.log"
  • Compare specified databases and save the synchronization script to the D:\compare_result.sql file:
/datacompare /source server:SqlServer1 database:db1 user:sa password:pswd /target server:SqlServer2 database:db2 user:sa password:pswd /sync:"D:\compare_result.sql"
  • Compare and synchronize databases using the settings from the file, ignore case during comparison; generate a report to the specified file in the HTML format:
/datacompare /compfile:"SC1vsSC2.dcomp" /icase:yes /report:"report.txt" /reportformat:HTML /sync