The /schemacompare command lets you run schema comparison from the command line.
Note
The command-line interface is available in the Professional and Enterprise editions of dbForge Studio for SQL Server.
dbforgesql.com /schemacompare [/option_name1[:value | [parameter1:value parameter2:value ..]] /option_name2 ..]
To view the list of switches available for /schemacompare, run the following command:
dbforgesql.com /schemacompare /?
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"
To enter all arguments, use one of these options:
dbforgesql.com /schemacompare /source connection:"Data Source=<server_name>;Initial Catalog=<catalog>;Integrated Security=False;User ID=yourUsername" /target connection:"Data Source=<server_name>;Initial Catalog=<catalog>;Integrated Security=False;User ID=yourUsername"
/argfile command./argfile:"D:\file_name.txt"
/compfile command./compfile:"C:\MyComparison.scomp"
To generate and save a log file, specify the file name and location in the /log command.
/log:"C:\LogFile.log"
/report command./report:"C:\Report.html"
/sync command./sync:"C:\sync_script.sql"
You can generate a .txt file with command-line arguments in the New Schema Comparison wizard or create a .bat file containing commands to be executed by the Command Prompt sequentially from the command-line wizard.
This command runs a comparison with predefined settings stored in the .scomp file without requiring you to specify parameters directly in the command line.
dbforgesql /schemacompare /compfile:"D:\workDir\SC1vsSC2.scomp"
This command compares the schema of db1 on SqlServer1 with db2 on SqlServer2 and generates a SQL synchronization script containing the SQL statements required to update the target database so that it matches the source database.
dbforgesql /schemacompare /source server:SqlServer1 user:sa password:sa database:db1 /target server:SqlServer2 user:sa password:sa database:db2 /sync:"D:\compare_result.sql"
This command performs a schema comparison using the settings stored in the .scomp project file, applies several comparison options, generates an HTML report, and then synchronizes the target with the source.
dbforgesql /schemacompare /compfile:"file_name.scomp" /icase:yes /IgnoreForeignKeys:yes /report:"report.html" /reportformat:HTML /groupby:objecttype /incsettings:T /sync
This command performs a schema comparison based on a saved project file (.scomp) and records the full execution log to D:\log_file.log.
dbforgesql /schemacompare /compfile:"file_name.scomp" /log:"D:\log_file.log"