Command-line switches

This topic provides a detailed description of command-line switches and examples of how to use them.

Command-line usage

To get more information on switches related to data comparison in the command line, run the following command:

dbforgesql.com /datacompare /?

Note

To run dbForge Studio CLI commands, open Command Prompt and navigate to the folder that contains dbforgesql.com. The default path to this executable depends on where dbForge Studio for SQL Server is installed. If you installed dbForge Studio:

  • As a standalone tool
C:\Program Files\Devart\dbForge Studio for SQL Server
  • As part of the dbForge Edge bundle
C:\Program Files\Devart\dbForge Edge\dbForge Studio for SQL Server

Available command-line switches

Name Description
/backup Creates a backup of the target database before synchronization.
If the backup directory is not specified, the default server backup directory is used.
Usage: /backup[:dir]
/compfile Loads command-line settings from the comparison project file (.dcomp).
Usage: /compfile:<file_path>
/exitcodes Displays the list of exit codes that can be returned by the command-line process.
Usage: /exitcodes
/IncludeObjects Specifies the objects to be included in the report:
  • All – All objects.
  • Diff – Objects with differences.
  • SelectForSync – Objects selected for synchronization.
    Usage: /includeobjects:<All|Diff|SelectForSync>
/log Generates a comparison log file in the specified directory.
Usage: /log:<file_path>
/meobjmask Excludes objects from the comparison if they match the given expression.
To exclude objects from the comparison, specify a mask expression.
To turn off the option, specify: No, N, Off, False, or F.
Usage: /meobjmask:<expression | No>
/micolmask Specifies a custom wildcard or regular expression for columns to be excluded from the comparison.
For example, if “ModifiedDate, CreatedOn, UpdatedBy” is set for this option, the columns with such names as UpdateByCustomer, NotUpdateByUser, RecordCreatedOn, MessageCreatedOnDay, LastModifiedDate, and ProductModifiedDateTime will be excluded from the comparison.
Usage: /micolmask:<expression | No>
/miobjmask Includes objects in comparison if they match the given expression.
To include objects to comparison, specify a mask expression.
To turn off the option, specify: No, N, Off, False, or F.
Usage: /miobjmask:<expression | No>
/options Specifies the values for comparison or synchronization options.
Usage: /{option}:[value]
/report Generates a data comparison report file.
If the output file name has an .html, .xls or .csv extension, the file format is automatically chosen.
Usage: /report:<file_path>
/reportformat Specifies the format of the comparison report file.
Available options:
  • HTML – A simple HTML file.
  • XLS – A simple Microsoft Excel file.
  • CSV – A simple CSV file.

If no format is specified, the report format is determined by the file extension.
Usage: /reportformat:<HTML|XLS|CSV>
/source Specifies the source for comparison by using one of the following options:
  • server:<name> database:<db> [user:<name>] [password:<pw>] – Connects to a live database using the specified parameters. If user is not specified, the system integrated security is used.
  • connection:<connection_string> – Specifies the full connection string with additional parameters.
  • backup:<file_path> setid:<GUID> – Loads a database backup from one or more files. To specify multiple backup files, repeat the backup:<file_path> parameter for each file. The setid parameter identifies the unique backup set.
  • scriptsfolder:<folder_path> – Loads database objects from the specified scripts folder.
/sync Performs data synchronization from the command line.
If you specify an output file for synchronization, only the synchronization script is generated.
Usage: /sync[:file_path]
/target Specifies the target for comparison by using one of the following options:
  • server:<name> database:<db> [user:<name>] [password:<pw>] – Connects to a live database using the specified parameters. If a user is not specified, the system integrated security is used.
  • connection:<connection_string> – Specifies the full connection string with additional parameters.
  • backup:<file_path> setid:<GUID> – Loads a database backup from one or more files. To specify multiple backup files, repeat the backup:<file_path> parameter for each file. The setid parameter identifies the unique backup set.
  • scriptsfolder:<folder_path> – Loads database objects from the specified scripts folder.

Note

To build the command-line syntax, use the Command-line wizard.