Switches used in the command line

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

Command line usage

schemacompare.com [/argfile:filepath] [/operation_switch] [/switch1[:value | [parameter1:value parameter2:value ..]] /switch2 ..]

The first argument for schemacompare is usually an operation switch that corresponds to the operation that you want to perform with the application.

Note

To run the Command Line in Windows 10:

From the Desktop Mode

  • Move the mouse cursor to the exact lower left corner until the desktop shortcuts menu appears.
  • Right-click to see the shortcut menu and than click Run.

From the Charms Bar

  • Move your mouse to the upper right corner until the Charms Bar appears.
  • Select Apps from the list and type ‘run’ in the search box.
  • Click Run from the search results.

Use Windows + R Shortcut Keys

  • In desktop mode, press the Windows + R keys, to show the Run command line.
  • In the window that opens, type cmd and press Enter.

Available command-line switches

Switch Usage
/argfile /argfile:<filepath>
Specifies the path to the command-line arguments file. Options specified in the command line have higher priority than the options that were given in the argfile.
/activate /activate /key:<activation_key>
Activates a product using activation key.
/deactivate Deactivates a product.
/execute Executes a script.
/schemacompare Launches schema comparison.
/script Generates scripts of a database.
/scriptsfolder Creates a scripts folder of a database.
/snapshot Creates a snapshot of a database.
/quiet (/q) Hides console window in console mode. It should be used after the main operation switch.

Switches details

/execute

Execute a script.

Parameter Description
/connection /connection:<connection_string>
Specifies the connection string.
/database Specifies a database to script or override the database specified in a template or in a connection string.
/encoding /encoding:<codepage|encoding name>
Specifies the encoding which should be applied to open and execute the script.
/inputfile Specifies an SQL or ZIP file with a script to execute.
/password /password:<yourPassword>
Specifies the server password or override the password specified in the connection string.
/zippassword /zippassword:<zip password>
Enters a password for protected archive with the script.

/schemacompare

Launch schema comparison.

Parameter Description
/source Specifies the source with the following options:
server:<name> database:<db> [user:<name>] [password:<pw>]
If ‘user’ is not specified, the system’s integrated security is used.
/connection:<connection_string>
snapshot:<filepath>
scriptsfolder:<folderpath>
/target Specifies target with the following options:
server:<name> database:<db> [user:<name>] [password:<pw>]
If ‘user’ is not specified, the system’s integrated security is used.
/connection:<connection_string>
snapshot:<filepath>
scriptsfolder:<folderpath>
/compfile /compfile:<path>
Loads command line settings from the comparison .scomp project file.
/filter /filter:<filepath>
Specifies a filter path to filter objects. To learn more, refer to Use object filter.
/options /{option}:[value]
Specifies the value for comparison, synchronization, or comparison report option. To turn on the option, specify: Yes, Y, On, True, T. To turn off the option, specify: No, N, Off, False, F. Forced disabling of an option from the CLI is necessary if the option is set via UI and then saved in a dcomp file.
You can use this switch as many times as many options you want to specify. For more information, refer to Options used in the command line.
/sync /sync[:path]
Launches database synchronization. If an output file path is specified, the program will generate only a synchronization script.
/report /report:<filepath>
Generates a schema comparison report file. If the output file name has .html, .xls or .csv extension, there’s no need to specify the file format as it will be automatically determined based on the extension.
For more information, refer to Options used in the command line.
/reportformat /reportformat:<HTML|XLS|CSV>
Specifies the format of the comparison report file. If the format is not specified, it is determined by the extension of the report file.
/includeobjects /includeobjects:<All|Filtered|Diff|SelectForSync
Specifies objects for the report:
* All - all objects;
* Filtered - filtered objects;
* Diff - objects with differences;
* SelectForSync - objects selected for synchronization.
The option refers specifically to the report generation in the HTML/XLS/XML formats and does not work separately from the /report:<filepath> key.
/log /log:<filepath>
Generates a comparison log file in the specified directory.

/script

Generate scripts of a database.

Parameter Description
/connection /connection:<connection_string>
Specifies the connection string.
/password /password:<pw>
Specifies the server password or override the password specified in the connection string.
/database Specifies a database to script or override the database specified in a template or in a connection string.
/outputfile Specifies a file name for storing the database script or override the file name specified in template.
/projectfile /projectfile:<path>
Specifies script template to use. Some template options can be overridden by switches.
To learn how to create a project file, refer to How to generate SQL Server database scripts.

/scriptsfolder

Create a scripts folder of a database.

Parameter Description
/connection /connection:<connection_string>
Specifies the connection string.
/password /password:<pw>
Specifies the server password or override the password specified in the connection string.
/database Specifies a database to script or override the database specified in a template or in a connection string.
/decrypt /decrypt:[value]
Defines if source objects should be decrypted during describing.
/includedata /includedata:[value]
Defines whether to include data. To turn on the option, specify: Yes, Y, On, True, T. To turn off the option, specify: No, N, Off, False, F. Forced disabling of an option from the CLI is necessary if the option is set via UI and then saved in a scomp file.
/path /path:<folder_path>
Defines a scripts folder path.

/snapshot

Create a snapshot of a database.

Parameter Description
/connection /connection:<connection_string>
Specifies the connection string.
/password /password:<yourPassword>
Specifies the server password or override the password specified in the connection string.
/database Specifies a database to script or override the database specified in a template or in a connection string.
/decrypt /decrypt:[value]
Defines if source objects should be decrypted during describing. To turn on the option, specify: Yes, Y, On, True, T. To turn off the option, specify: No, N, Off, False, F. Forced disabling of an option from the CLI is necessary if the option is set via UI and then saved in a scomp file.
/compress /compress:[value]
Defines if snapshot file should be compressed. To turn on the option, specify: Yes, Y, On, True, T. To turn off the option, specify: No, N, Off, False, F. Forced disabling of an option from the CLI is necessary if the option is set via UI and then saved in a scomp file.
/file /file:<file_path>
Defines a snapshot file location.

Note

To build the command-line syntax, it’s better to use the Command-line Wizard.

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Schema Compare for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Schema Compare in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Schema Compare for your business, request a demo to see it in action.
Ready to start using dbForge Schema Compare for SQL Server?