The /datacompare command lets you run data 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 /datacompare [/option_name1[:value | [parameter1:value parameter2:value ..]] /option_name2 ..]
To view the list of arguments available for the /datacompare command, run the following command:
dbforgesql.com /datacompare /?
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 the following options:
dbforgesql.com /datacompare /source connection:"Data Source=<server_name>;Initial Catalog=<catalog>;Integrated Security=False;User ID=yourUsername;Password=yourPassword" /target connection:"Data Source=<server_name>;Initial Catalog=<catalog>;Integrated Security=False;User ID=yourUsername;Password=yourPassword"
/argfile command./argfile:"D:\file_name.txt"
/compfile command./compfile:"C:\MyComparison.dcomp"
To synchronize the data and generate a synchronization script, specify the file location and name in the /sync command.
/sync:"D:\sync_script.sql"
/log command./log:"D:\LogFile.log"
/report command./report:"D:\MyReport.html"
/reportformat command./reportformat:HTML
You can generate a .txt file with command-line arguments in the New Data Comparison wizard or create a .bat file containing commands to be executed by the Command Prompt sequentially from the command-line wizard.
This command compares data in a backup file with a live target database, then generates a synchronization script and a report.
dbforgesql.com /datacompare /source backup:"D:\backup_file.bak" /target server:<target_server> database:<target_database> user:<user_name> password:<pw> /CheckIdentical:Yes /sync:"D:\sync_script.sql" /report:"D:\report_file.html"
This command compares two live SQL Server databases, synchronizes them, and logs all activity to a file.
dbforgesql.com /datacompare /source connection:"Connect Timeout=120;Data Source=<source_server>;Initial Catalog=<source_database>;Integrated Security=False;User ID=<source_username>;Password=<source_pw>;Pooling=False" /target connection:"Connect Timeout=120;Data Source=<target_server>;Initial Catalog=<target_database>;Integrated Security=False;User ID=<target_username>;Password=<target_pw>;Pooling=False" /sync /log:"D:\sync.log"
This command compares the data of the specified databases and saves a synchronization script to a .sql file.
dbforgesql.com /datacompare /source connection:"Data Source=<source_server>;Initial Catalog=<source_database>;Integrated Security=True" /target connection:"Data Source=<target_server>;Initial Catalog=<target_database>;Integrated Security=True" /sync:"D:\sync_script.sql"
dbforgesql.com /datacompare /compfile:"D:\file.dcomp" /nocomments:yes /nodml:yes /report:"D:\report.html" /reportformat:HTML /sync
dbforgesql.com /datacompare /compfile:"D:\workDir\DC1vsDC2.dcomp" /fspath:"\\SqlHost\Temp" /sync
dbforgesql.com /datacompare /compfile:"D:\Compare\DC1vsDC2.dcomp" /report:"D:\Reports\CompReportDC1vsDC2.html" /reportformat:html /includeobjects:All /incdata:Yes /incs:Yes