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 /execute, run the following command:

dbforgesql.com /execute /?

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

All switches available for this option are listed below, along with usage examples.

Name Description
/connection Specifies the connection string.
Example:
dbforgesql.com /execute /connection:"User Id=your_username;Server=your_server_name
Usage: /connection:<connection_string>
/database Executes the script against a specific database. Databases inside the script are ignored. Fully qualified object names are not affected.
Usage: /database:<database_name>
/encoding Specifies the encoding for opening and executing the script.
Usage: /encoding:<codepage|encoding name>
/errormode Specifies the application’s behavior when an error occurs:
  • ignore – Ignores the error.
  • abort – Cancels execution.

Usage: /errormode:<ignore|abort>
/exitcodes Displays the list of exit codes that can be returned by the command-line process.
Usage: /exitcodes
/inputfile Specifies the .sql or .zip file containing the script to execute.
Usage: /inputfile:<file_path>
/password Specifies the server password and overrides the values specified in the /connection parameter.
Usage: /password:<pw>
/treatwarningaserror 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.

Usagea: /treatWarningAsError:[Yes|No]
/zippassword Specifies the password for the protected archive.
Usage: /zippassword:<zip password>

For more examples, see Execute SQL scripts from the command line.