Switches used in the command line
Last modified: March 28, 2025
This topic gives a detailed description of command-line switches and examples of their usage.
Access available SQL Complete switches
To access help regarding the available command line arguments, use the following command:
sqlcomplete.com /?
For more information on each command-line operation, run the following command and specify the required option value sqlcomplete /option_name /?
. For example, sqlcomplete /formatsql /?
.
Note
To run the Command Line in Windows 11:
From the Windows taskbar
- Right-click the taskbar at the bottom of the screen and select Run. Alternatively, select Start or press Windows on the keyboard to open the Start menu.
- In the Search bar, enter cmd or Command Prompt.
- Select Command Prompt from the search results.
Using shortcut keys
- Press Windows + R to open the Run command window.
- In the window that opens, enter cmd and press Enter.
Command line usage
sqlcomplete [/argfile:path] [/operation_switch] [/switch1[:value | [parameter1:value parameter2:value ..]] /switch2 ..]
The first argument for sqlcomplete
is an operation switch, which indicates the specific action you want to execute with the application.
Available command-line switches
Switch | Usage |
---|---|
/argfile |
/argfile:<path> Specify a path to the command-line arguments file. Options specified in the command line have higher priority than those given in the file. |
/activate |
/activate /key:<activation_key> Activate a product using the activation key. |
/deactivate |
Deactivate a product. |
/findinvalidobjects |
Find any objects referencing other objects that were dropped and no longer exist in the database. |
/formatsql |
Format SQL files with the specified profile. |
/quiet (/q ) |
Hide all messages in console mode. It should be used after the main operation switch. |
Switches details
/findinvalidobjects
Find any objects referencing other objects that were dropped and no longer exist in the database.
Parameter | Description |
---|---|
/alldatabases |
Usage: /alldatabases Find invalid objects for all non-system databases specified in the /connection parameter. |
/connection |
Usage: /connection:<connection_string> Specify the connection string. |
/database |
Usage: /database:<dbname1[,dbname2]> Specify the database(s) and override the values specified in the /connection parameter. You can specify either a single database or multiple databases separated by commas. |
/errormode |
Usage: /errormode:<ignore|abort> Specify the application behavior when encountering an error:Ignore: Ignore all errors and continue execution.Abort: Cancel execution if an error occurs. |
/exitcodes |
Usage: /exitcodes Display the list of exit codes that can be returned by the command-line process. |
/log |
Usage: /log:<filepath> Generate a log file and saves it to the specified folder. |
/password |
Usage: /password:<pw> Specify the server password and overrides the values specified in the /connection parameter. |
/report |
Usage: /report:<filename> Generate a report in the CSV file format. |
/treatwarningaserror |
Usage: /treatWarningAsError:[Yes|No] Specify the behavior for treating warnings.Yes : Treat all warnings as errors, and the subsequent behavior will be determined by the errormode option.No : Do not consider warnings to be errors and continue the command line execution. |
/formatsql
Format SQL files with the specified profile.
Parameter | Description |
---|---|
/connection |
Usage: /connection:<connection_string> Specify the connection string. |
/encoding |
Usage: /encoding:<codepage|encoding name> Specify the encoding which should be applied to open and save files. |
/errormode |
Usage: /errormode:<ignore|abort> Specify the application behavior when encountering an error:Ignore: Ignore all errors and continue execution.Abort: Cancel execution if an error occurs. |
/exitcodes |
Usage: /exitcodes Display the list of exit codes that can be returned by the command-line process. |
/filextension |
Usage: /filextension:*.<sql|prc|txt|...> Specify the extension of the source folder files that will be formatted. The .sql extension is chosen by default. |
/includesubfolders |
Usage: /includesubfolders <brInclude the current directory and all subdirectories in the search operation. |
/log |
Usage: /log:<filepath> Generate a log file and saves it to the specified folder. |
/outputfile |
Usage: /outputfile: |
/outputfolder |
Usage: /outputfolder:<path> Specify the path to an output folder where the source folder files with formatting results will be saved. Files from the source folder will not be changed. If the parameter is not specified, the formatting results will be saved in the source folder files. |
/password |
Usage: /password:<pw> Specify the server password and overrides the values specified in the /connection parameter. |
/profile |
Usage: /profile:<path>|<profile name> Specify the path to the file that contains formatting options settings or predefined profile name. If the parameter is not specified, default formatting options settings will be applied. |
/sourcefile |
Usage: /sourcefile:<path> Specify the source SQL file to be formatted. |
/sourcefolder |
Usage: /sourcefolder:<path> Specify the path to the folder where the files for formatting are located. |
/treatwarningaserror |
Usage: /treatWarningAsError:[Yes|No] Specify the behavior for treating warnings.Yes : Treat all warnings as errors, and the subsequent behavior will be determined by the errormode option.No : Do not consider warnings as errors and continue the command line execution. |