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.
Below, you will find the list of comparison and synchronization options with their full and short command line names.
| Full Name | Short Name | Option |
|---|---|---|
| AddBackupType | addbt | Create a differential database backup |
| AddingErrorHandling | adderrorhandle | Handle errors when performing comparison and synchronization |
| AddTransactionIsolationLevel | addtransiso | Specify transaction isolation level |
| AppendTimestampReport | tsreport | When selected, the folder name for the comparison report will be generated with timestamp |
| BackupPath | backup | Specify the location of the backup file |
| BackupExtension | extbackup | Specify the extension for the backup file |
| BulkInsert | bi | Use bulk insert for data insertion |
| CheckConcurrencyUpdates | concupd | Check for the concurrency updates |
| CheckDifferent | chkdiff | Include different records into comparison results |
| CheckIdentical | chkequal | Include identical records into comparison results |
| CheckOnlyInSource | chksource | Include only in source records into comparison results |
| CheckOnlyInTarget | chktarget | Include only in target records into comparison results |
| CompareClrTypesAsBinary | clrasbin | Compare and synchronize CLR types as binary, otherwise as string |
| CompareColumnStoreTables | colstore | Compare tables with COLUMNSTORE indexes |
| CompareMemoryOptimizedTables | moptimize | Compare memory optimized tables |
| CompareTables | tables | Include tables into comparison |
| CompareViews | views | Include views into comparison |
| CreateBackupFolder | cbackupfolder | Create folder for database backup |
| IncludeDifferencesPerColumns | incdiffcols | When selected, the number of differences per column will be displayed |
| DisableDdlTriggers | noddl | When selected, DDL triggers will be disabled at the beginning of the synchronization. After the synchronization, they will be enabled. |
| DisableDmlTriggers | nodml | When selected, DML triggers will be disabled at the beginning of the synchronization. After the synchronization, DML triggers are re-enabled. The option is applicable to tables and views. |
| DisableForeignKeys | nofk | When selected, foreign keys will be dropped at the beginning of the synchronization. After the synchronization, foreign keys will be restored. |
| DisableSecurityPolicy | dissecpol | Disable security policies before synchronization and enable after that |
| DropCheckConstraints | dropcheck | Drop check and not null constraints in the beginning of synchronization |
| DropKeys | dropkeys | Disable primary keys, indexes and unique constraints |
| ExcludeComments | nocomments | Prevent comments generation in a synchronization script |
| ExcludeNewAddedObjects | excnewaddedobj | Compare only those tables and views that are explicitly included in the saved project (*.dcomp) |
| ExcludeObjectsByMask | meobjmask | Exclude tables or views by mask |
| ExecuteAsSingleTransaction | tran | Execute a synchronization script as a single transaction |
| IncludeOnlyColumnsWithChanges | inccolswchanges | When selected, columns containing no differences will be hidden |
| IgnoreBlobColumns | miblob | Ignore blob columns during comparison |
| IgnoreCase | icase | When selected, the comparison of the (N)CHAR, (N)VARCHAR, (N)VARCHAR(MAX), (N)TEXT and CLR datatypes is case-insensitive. The option doesn’t affect the key comparison columns. The maximum allowable string size for the option to be applied is 5 MB. |
| IgnoreColumnsByMask | micolmask | Specify a custom wildcard expression for columns names to exclude columns from comparison |
| IgnoreComputedColumns | micomput | Ignore computed columns |
| IgnoreEndOfLine | ieol | Ignore end of line characters during comparison and synchronization |
| IgnoreIdentityColumns | miident | Ignore identity columns during comparison |
| IgnoreLeadingSpaces | ilspaces | Ignore leading spaces |
| IgnoreRowguidColumns | mirowguid | Ignore ROWGUID columns during comparison |
| IgnoreTemporalTableSysColumns | isyscol | Ignore column is SYSTEM_TIME for temporal tables |
| IgnoreTimestampColumns | mitime | Ignore TIMESTAMP columns during comparison |
| IgnoreTrailingSpaces | ispaces | Ignore whitespaces in the end of strings during comparison and synchronization |
| IncludeComparisonSettings | incsettings | When selected, the comparison report will include the comparison and synchronization settings |
| IncludeIdenticalObjects | incident | Include identical objects |
| IncludeObjectsByMask | miobjmask | Include tables or views by mask |
| IncludeObjectsData | incdata | Include objects data |
| IncludePrintComments | iprint | Include print comments into output while executing the script |
| IncludeUseDatabase | inud | Add USE <database_name> clause to the script |
| IncludeSyncWarnings | incwarnings | When selected, the comparison report will include the comparison or synchronization warnings, if there are any |
| IsEmptyStringEqualsNull | emptyeqnull | Treat NULL and EMPTY STRING as the same value |
| IsIgnoreTime | itime | Ignore time for fields of the DATETIME type and compare only dates |
| MappingIgnoreCase | micase | Ignore case in object names when mapping them |
| MappingIgnoreSpaces | mispace | Ignore spaces in object names when mapping them |
| MappingIgnoreUnderscores | miunder | Ignore underscore in object names when mapping them |
| NeedCompressBackup | comprbackup | Perform backup compression |
| ReseedIdentityColumns | reseed | Reseed a current value for identity columns |
| RestoreConstraintsWithCheck | checkconstrrestore | Restore constraints with CHECK |
| RoundFloatTypes | round | Round float types up to 3 digits |
| ToleranceInterval | tol | Specify the module of difference between the values of source and target |
| UseSchemaNamePrefix | fullnames | Generate fully qualified object names |
Below, you will find the list of comparison report options with their full and short command line names.
| Full Name | Short Name | Option |
|---|---|---|
| AppendTimestampReport | tsreport | Generate comparison reports with a timestamp |
| DifferentPerColumns | diffpercolumns | Display the number of differences per column |
| HideUnmodifiedColumns | hidecolumns | Hide the columns containing no differences |
| IncludeSyncWarnings | incwarnings | Include the comparison or synchronization warnings in the comparison report, if any |
/datacompare /compfile:"D:\workDir\SC1vsSC2.dcomp"
/datacompare /source host:SqlServer1 user:sa password:psw database:db1 /target host:SqlServer2 user:sa password:pswd database:db2 /sync /log:"D:\sync.log"
/datacompare /source host:SqlServer1 database:db1 user:sa password:pswd /target host:SqlServer2 database:db2 user:sa password:pswd /sync:"D:\compare_result.sql"
/datacompare /compfile:"SC1vsSC2.dcomp" /icase:yes /report:"report.txt" /reportformat:HTML /sync
### 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 host:SqlServer1 user:sa password:psw database:db1 /target host: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 host:SqlServer1 database:db1 user:sa password:pswd /target host: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 ~~~