Switches used in the command line

The aim of this section is to provide a list of the switches you can use with the Schema Compare tool in command line.

Command line usage

schemacompare [/argfile:path] [/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.

Available command-line switches

Switch Usage
/argfile /argfile:<path>
  Path to command-line arguments file. Options specified in the command line have higher priority than the options which were given in the file.
/activate Activate a product using activation key.
/deactivate Deactivate a product.
/execute Execute a script.
/schemacompare Launch schema comparison.
/script Script a database.
/scriptsfolder Create a scripts folder of the target schema.
/snapshot Make a snapshot of the target schema.
/quiet (/q) Hide console window in console mode. It should be used after the main operation switch.

Switches details

/execute

Execute script.

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

/schemacompare

Launch schema comparison.

Parameter Description
backup Usage: /backup[:dir]
  * If target is live database: makes a backup of target database before the synchronization.
  * If the backup directory is not specified, the default server’s backup directory is used.
  * If target is a scripts folder: makes a copy of a target scripts folder before the synchronization.
  * If the copy folder is not specified, the default user’s backup directory is used.
compfile Is used to load command line settings from comparison .scomp project file: /compfile:<path>
log Is used to generate comparison log file in the specified directory: /log:<filepath>
options Is used to specify the value for comparison or synchronization option: /{option}:[value]
  * To turn on the option, specify: Yes, Y, On, True, T.
  * To turn off the option, specify: No, N, Off, False, F.
  You can use this switch as many times as many options you want to specify.
  For more information, see Options used in the command line.
report Is used to generate schema comparison report file: /report:<filepath>. If the output file name has .html, .xls or .csv extension, it’s not necessary to specify the file format - it will be chosen depending on the extension.
reportformat Is used to specify the format of the file comparison report: /reportformat:<HTML/XLS/XML>
  If the format was not specified, it is determined by the extension of the report file.
source Is used to specify 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>
sync Is used to launch database synchronization: /sync[:path]
  If an output file path is specified, the program will generate only a synchronization script.
target Is used to specify 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>

/script

Script database.

Parameter Description
connection Is used to specify the connection string: /connection:<connection_string>
database Is used to specify a database to script or override the database specified in a template or in a connection string.
outputfile Is used to specify a file name for storing the database script or override the file name specified in template.
password Is used to specify the server password or override the password specified in the connection string: /password:<pw>
projectfile Is used to specify script template to use. Some template options can be overridden by switches: /projectfile:<path>

/scriptsfolder

Make a scripts folder of a target database.

Parameter Description
connection Is used to specify the connection string: /connection:<connection_string>
database Is used to specify a database to script or override the database specified in a template or in a connection string.
decrypt Is used to define if source objects should be decrypted during describing: /decrypt:[value]
includedata Is used to define whether to include data: /includedata:[value]
  * To turn on the option, specify: Yes, Y, On, True, T.
  * To turn off the option, specify: No, N, Off, False, F.
password Is used to specify the server password or override the password specified in the connection string: /password:<pw>
path Is used to define a scripts folder path: /path:

/snapshot

Make a snapshot of a target schema.

Parameter Description
compress Is used to define if snapshot file should be compressed: /compress:[value]
  * To turn on the option, specify: Yes, Y, On, True, T.
  * To turn off the option, specify: No, N, Off, False, F.
connection Is used to specify the connection string: /connection:<connection_string>
database Is used to specify a database to script or override the database specified in a template or in a connection string.
decrypt Defines if source objects should be decrypted during describing: /decrypt:[value]
  * To turn on the option, specify: Yes, Y, On, True, T.
  * To turn off the option, specify: No, N, Off, False, F.
file Is used to define a snapshot file location: /file:
password Is used to specify the server password or override the password specified in the connection string: /password:<pw>