This topic gives a detailed description of command-line switches and examples of their usage.
schemacompare [/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.
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. |
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. |
Launch schema comparison.
Parameter | Description |
---|---|
/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. |
/log | /log:<filepath> Generates a comparison log file in the specified directory. |
/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. |
/report | /report:<filepath> Generates a schema comparison report file. If the output file name has a .html, .xls or .csv extension, it’s not necessary to specify the file format - it will be chosen depending on the extension. For more information, refer to Options used in the command line. |
/reportformat | /reportformat:<HTML|XLS|XML> Specifies the format of the file comparison report: HTML - a simple HTML file; XLS - a simple Microsoft Excel file; CSV - a simple CSV file. If the format was not specified, it is determined by the extension of the report file. |
/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> |
/sync | /sync[:path] Launches database synchronization. If an output file path is specified, the program will generate only a synchronization script. |
/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> |
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. |
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. |
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.