Command-line switches

This topic gives a detailed description of command-line switches and examples of their usage.

Command-line usage

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

dbforgesql /schemacompare /?

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 (.scomp).
Usage: /compfile:<path>
/exitcodes Displays the list of exit codes that can be returned by the command-line process.
Usage: /exitcodes
/filter Applies a custom filter to include or exclude objects from comparison.
/filter:<filepath>
/IncludeObjects Specifies the objects to be included into report:
  • All – All objects.
  • Filtered – Filtered objects.
  • Diff – Objects with differences.
  • SelectForSync – Objects selected for synchronization.
    Usage: /includeobjects:<All|Filtered|Diff|SelectForSync>
/log Generates a comparison log file in the specified directory.
Usage: /log:<filepath>
/options Specifies the values for comparison or synchronization options.
Usage: /{option}:[value]
/report Generates a schema comparison report file.
If the output file name has an .html, .xls or .xml extension, the file format is selected automatically.
Usage: /report:<filepath>
/reportformat Specifies the format of the file comparison report.
Available options:
  • HTML – A simple HTML file.
  • XLS – A simple Microsoft Excel file.
  • XML – A simple XML file.
  • XMLFOREXCEL – A simple XML file for Microsoft Excel.

If no format is specified, the report format is determined by the file extension.
Usage: /reportformat:<HTML|XLS|XML|XMLFOREXCEL>
/ScriptDiffsStyle Specifies the style of displaying script differences in the comparison report.
Available options:
  • removeadd – Highlights removed and added lines.
  • cross – Applies strikethrough to removed symbols and highlights added symbols.

Usage: /ScriptDiffsStyle:<removeadd|cross>
/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.
  • snapshot:<filepath> – Loads the database from the specified snapshot file. If a user is not specified, the system-integrated security is used.
  • backup:<filepath> setid:<GUID> – Loads a database backup from one or more files. To specify multiple backup files, repeat the backup:<path> parameter for each file. The setid parameter identifies the unique backup set.
  • scriptsfolder:<folderpath> – Loads database objects from the specified scripts folder.
/sync Performs schema synchronization from the command line.
If you specify an output file for synchronization, only synchronization script is generated.
Usage: /sync[:filepath]
/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.
  • snapshot:<filepath> – Loads the database from the specified snapshot file. If a user is not specified, the system-integrated security is used.
  • backup:<filepath> setid:<GUID> – Loads a database backup from one or more files. To specify multiple backup files, repeat the backup:<path> parameter for each file. The setid parameter identifies the unique backup set.
  • scriptsfolder:<folderpath> – Loads database objects from the specified scripts folder.

Note

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