Command-line switches

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

Command-line usage

To view command-line switches for /formatsql, run the following command:

dbforgesql.com /formatsql /?

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 Usage Description
/connection /connection:<connection_string> Specifies the database connection string.
/encoding /encoding:<codepage|encoding_name> Specifies the encoding to use when opening and saving files.
/errormode /errormode:<ignore|abort> Specifies the application’s behavior when an error occurs:
  • ignore – Ignores the error.
  • abort – Cancels execution.
/exitcodes /exitcodes Lists exit codes returned by the command. For more information, see Exit codes used in the command line.
/fileextension /fileextension:*.<sql|prc|txt|...> Specifies the extension of the source folder files to format. The default value is .sql.
/includesubfolders /includesubfolders Includes the current folder and its subfolders in the formatting operation.
/log /log:<file_path> Specifies the full path to the log file.
/outputfile /outputfile:<file_path> Specifies the full path to the resulting formatted file. The source file remains unchanged. If not specified, the formatting results overwrite the source file.
/outputfolder /outputfolder:<folder_path> Specifies the path to the folder for the resulting formatted files. Files from the source folder remain unchanged. If not specified, the formatting results overwrite the source folder files.
/password /password:<password> Specifies the server password. Overrides the password in the connection string.
/profile /profile:<path>|<profile_name> Specifies the full path to the file that contains formatting settings or the name of a predefined profile. If not specified, default formatting settings are applied.
/sourcefile /sourcefile:<path> Specifies the full path to the file to format.
/sourcefolder /sourcefolder:<path> Specifies the path to the folder that contains files to format.
/treatwarningaserror /treatwarningaserror:[Yes|No] Specifies how to treat warnings:
  • Yes – Warnings are treated as errors; further behavior is determined by the /errormode argument.
  • No – Warnings aren’t treated as errors; execution continues with warning messages.

For more examples, see Format code from the command line.