How to compare and synchronize data

You can automate data comparison and synchronization using the command line.

Running comparisons from the Command Line

  1. Click Start.
  2. Type cmd in the Search programs and files text box and press ENTER.

  3. Type a path to the dbforgesql.com file located in the dbForge Studio for SQL Server installation folder on your PC, and press the SPACE bar.
C:\Program Files\Devart\dbForge Studio for SQL Server\dbforgesql.com

Note

The path to the executable file will differ depending on how you have installed the Studio - as a standalone tool or as part of the dbForge Edge bundle. Make sure that you have specified a correct path. If you have installed the Studio as part of dbForge Edge, change the path accordingly:

C:\Program Files\Devart\dbForge Edge\dbForge Studio for SQL Server>dbforgesql.com
  1. Specify command line arguments: connection strings and actions you want to run. For example, specify the type of the operation.
C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /datacompare /?
  1. Specify the objects that will be compared and synchronized.
C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /datacompare /compfile:"D:\mycompdoc.dcomp"
  1. Synchronize data directly into the database and generate a synchronization script file.
 C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /datacompare /compfile:"D:\mycompdoc.dcomp" /sync:"D:\mysync.sql" 
  1. Generate a comparison and synchronization protocol into a file.
C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /datacompare /compfile:"D:\mycompdoc.dcomp" /sync:"D:\mysync.sql" /log:"D:\mylog.log" 
  1. Compose a comparison report.
C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /datacompare /compfile:"D:\mycompdoc.dcomp" /sync:"D:\mysync.sql" /log:"D:\mylog.log" /report:"D:\myreport.html" 
  1. Specify the report format. HTML and EXCEL formats are available.
C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /datacompare /compfile:"D:\mycompdoc.dcomp" /sync:"D:\mysync.sql" /log:"D:\mylog.log" /report:"D:\myreport.html" /reportformat:HTML
  1. Press ENTER to run the process.

Tip To see a quick help on the arguments available in the command line, type the following:

C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /?

Generate File With Command Line Arguments

To generate a file with command line arguments, open the Data Comparison wizard.

To access the Data Comparison wizard, click New Data Comparison on the Comparison menu.

Select Source and Target for comparison. Go through other wizard pages to tune the data comparison.

On the Options tab, click Save settings to a command line arguments file and specify the file name and location to save the file. The selected Source and Target connection strings along with comparison options will be saved as command line arguments in the file. You can edit the values of comparison options in the file.

Note that the generated file does not contain password information for security purposes. You should edit the file and enter the passwords manually.

You can see available additional arguments and learn how to use them in the Additional /datacompare Arguments topic.

The command line string with /argfile parameter will be written as follows:

C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /argfile:file_name.txt

Download dbForge Studio for SQL Server and try it absolutely free for 30 days!

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Studio in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Studio for your business, request a demo to see it in action.
Ready to start using dbForge Studio for SQL Server?