dbForge Studio for SQL Server provides a command-line interface (CLI) that enables you to automate and schedule operations with SQL scripts without using the graphical user interface.
The command-line interface is available in the Professional and Enterprise editions of dbForge Studio for SQL Server.
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:
C:\Program Files\Devart\dbForge Studio for SQL Server
C:\Program Files\Devart\dbForge Edge\dbForge Studio for SQL Server
The /execute command runs a single SQL script or multiple SQL scripts sequentially from a .zip archive.
dbforgesql.com /execute [/option_name1[:value | [parameter1:value parameter2:value ..]] /option_name2 ..]
The following command enables you to view the switches available for /execute.
dbforgesql.com /execute /?
For the complete list of switches, see Command-line switches.
You can enter all the necessary arguments directly in the command line when running a command.
dbforgesql.com /execute /connection:"Data Source=<server_name>;Integrated Security=False;User ID=<user_name>" /inputfile:"<file_path>"
where:
/inputfile:"<file_path>" – The full path to a .sql file that contains the script you want to execute.Alternatively, you can list all arguments in a .txt arguments file and execute the script using this file instead of entering arguments in the command line.
dbforgesql.com /argfile:"D:\ArgumentsFileWithSettings.txt"
where:
/argfile:"D:\ArgumentsFileWithSettings.txt" – The full path to the arguments file that contains the required arguments and their values, such as /execute and /inputfile.For detailed automation scenarios, see:
The /execute command returns exit codes that indicate the operation status.
For the complete list of exit codes, see Command-line exit codes.
dbForge Studio provides a built-in command-line wizard that helps you generate reusable command-line commands based on actions configured in the graphical user interface.
Instead of writing command-line syntax manually, you can configure script execution settings in the command-line wizard. The wizard then generates the corresponding command-line syntax, which you can review, edit, and save to a .bat file for reuse or scheduling.
