dbForge Studio for SQL Server supports a command-line interface (CLI) that enables you to automate and schedule schema comparison and synchronization tasks. You can use the CLI for automated workflows or run comparisons without using the graphical interface.
The command-line interface is available in the Professional and Enterprise editions of dbForge Studio for SQL Server.
To use the dbForge Studio command-line interface, open the dbForge Studio for SQL Server installation folder that contains the dbforgesql.com file.
dbforgesql.com is a command-line interface (CLI) executable installed with dbForge Studio for SQL Server. You can use it for running SQL scripts from the command line and automating database tasks.
The /schemacompare command launches schema comparison and synchronization.
dbforgesql /schemacompare [/option_name1[:value | [parameter1:value parameter2:value ..]] /option_name2 ..]
dbforgesql /schemacompare /source connection:"Data Source=demo-mssql\SQLEXPRESS02;Encrypt=False;Initial Catalog=AdventureWorks2022Dev;Integrated Security=False;User ID=JordanS" /target connection:"Data Source=demo-mssql\SQLEXPRESS01;Encrypt=False;Initial Catalog=AdventureWorks2022Test;Integrated Security=False;User ID=JordanS" /MappingIgnoreSpaces:Yes /MappingIgnoreCase:Yes /sync
For detailed automation scenarios, see:
The following command enables you to view the switches available for /schemacompare.
dbforgesql /schemacompare /?
For the complete list of switches, see Command-line switches.
You can specify comparison and synchronization options in the following ways:
Directly in the command prompt
Use full or short option names with the /options switch.
For the complete list of command-line options, see Command-line options.
Using an arguments file
Generate a .txt arguments file with the help of the New Schema Comparison wizard, then specify it using the /argfile switch:
dbforgesql /schemacompare /argfile:"D:\FileWithArguments.txt"
The /schemacompare command returns exit codes that indicate the operation result. 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 interface.
Instead of writing command syntax manually, you configure a schema comparison or synchronization. The wizard then generates the corresponding command-line syntax, which you can review, edit, and save as a .bat file for reuse or scheduling.
