Command-line interface

dbForge Studio for SQL Server provides a command-line interface (CLI) that enables you to automate and schedule report creation tasks without using the graphical user interface.

What you can do with the command-line interface

  • Automate report creation from the command line.
  • Automate report creation using a template file.
  • Schedule report creation.
  • Create parameterized reports.
  • Create reports on the local disk and send them by email, if necessary.

Availability

The command-line interface is available in the Professional and Enterprise editions of dbForge Studio for SQL Server.

Access to the command-line interface

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
cd C:\Program Files\Devart\dbForge Studio for SQL Server
  • As part of the dbForge Edge bundle
cd C:\Program Files\Devart\dbForge Edge\dbForge Studio for SQL Server

Command-line syntax

The /datareport command initiates report creation from the command line.

dbforgesql.com /datareport [/option_name1[:value | [parameter1:value parameter2:value ..]] /option_name2 ..]

Command-line switches

The following command enables you to view the switches available for /datareport.

dbforgesql.com /datareport /?

For the complete list of switches, see Command-line switches.

Example

You can specify the required arguments directly in the command line.

dbforgesql.com /datareport /connection:"Data Source=<server_name>;Integrated Security=False;User ID=<user_name>" /format:HTML /result folder:"D:\Reports\Output\"

Alternatively, you can define report settings in a template file (.rdb), which the command references when running the script.

dbforgesql.com /datareport /reportfile:"D:\ReportTemplateFile.rdb"

where:

  • /reportfile:"D:\ReportTemplateFile.rdb" – The full path to a template file (.rdb).

For detailed automation scenarios, see:

  • Automate report generation from the command line
  • Schedule report creation
  • Create a parameterized report
  • Save a report locally and send it by email

Command-line exit codes

The /datareport command returns exit codes that indicate the operation status.

For the complete list of exit codes, see Command-line exit codes.

Command-line wizard

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 report settings in the command-line wizard. The wizard then generates the corresponding command-line syntax, which you can review, edit, and save as a .bat file for reuse or scheduling.

Command-line wizard for report creation