Additional schema compare arguments
Last modified: March 28, 2025
This topic gives detailed description of command line switches and examples of their usage.
Arguments
To get more information on switches related to schema comparison in the command line interface, you can type:
C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /schemacompare /?
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
Below all switches of this option are described, together with usage examples.
Argument | Action and Usage |
---|---|
/source |
Specifies source with the following options: server:yourservername> database:yourdb [user:yourusername] [password:yourpassword] Connects to a live database by specified parameters. If user is not specified, the system’s integrated security is used. connection:<connection_string> Allows specifying the full connection string with additional parameters. snapshot:<filepath> specifies the file path to a database schema snapshot file (.snap) that captures the structure of a database in the XML format Loads a database from the specified snapshot file. backup:<filepath> setid:<GUID> Loads a database backup from one or several files. To specify multiple backup files, you should specify the backup:path parameter as many times as many files you have. The “setid” parameter specifies unique backup set. scriptsfolder:<folderpath> serverversion:<serverversion> collation:<collation> Specifies the folder path to a scripts folder containing SQL scripts that represent the objects of a database. To specify the file path to a SQL Server backup file (.bak) or backup files taken from the differential backup: backup:<filepath> [backup:<filepath> ...] |
/target |
Specifies target with the following options: server:yourservername database:yourdb [user:yourusername] [password:yourpassword] Connects to a live database by specified parameters. If user is not specified, the system’s integrated security is used. connection:<connection_string> Allows specifying the full connection string with additional parameters. snapshot:<filepath> specifies the file path to a database schema snapshot file (.snap) that captures the structure of a database in the XML format Loads a database from the specified snapshot file. backup:<filepath> setid:<GUID> Loads a database backup from one or several files. To specify multiple backup files, you should specify the backup:path parameter as many times as many files you have. The setid parameter specifies unique backup set. scriptsfolder:<folderpath> serverversion:<serverversion> collation:<collation> Specifies the folder path to a scripts folder containing SQL scripts that represent the objects of a database. To specify the file path to a SQL Server backup file (.bak) or backup files taken from the differential backup: backup:<filepath> [backup:<filepath> ...] |
/compfile |
/compfile:<path> Loads command line settings from the comparison project file, *.scomp. Example of using a file with comparison settings, saved earlier: C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /schemacompare /compfile:"D:\workDir\OSC1vsOSC2.scomp" |
/options |
Sets some comparison and synchronization options directly in the command line interface. See the list of available options and learn how to use them in the Command Line Options for /schemacompare Operation topic. |
/sync |
/sync[:filepath] Performs schema synchronization from the command line interface. If you specify output file for synchronization, only synchronization script will be generated. The following example shows how to compare schemas using settings from the file saved before, and save synchronization script: C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /schemacompare /compfile:"OSC1vsOSC2.scomp" /sync:"D:\compare_result.sql" |
/report and /reportformat |
/report:<filepath> /reportformat:<HTML|XLS|XML|XMLFOREXCEL> Generates schema comparison report in .html, .xls, and .xml format. If you specify file format in the output file name in the /report switch, it is not necessary to use the /reportformat switch. Commands usage looks like: The following example shows how to compare schemas using settings from a file, generate report to the specified file in the HTML format: C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /schemacompare /compfile:OSC1vsOSC2.scomp /report:report.txt /reportformat:HTML |
/includeobjects |
/includeobjects:<All|Filtered|Diff|SelectForSync Specifies objects for the report: * All - all objects; * Filtered - filtered objects; * Diff - objects with differences; * SelectForSync - objects selected for synchronization. The option refers specifically to the report generation in the HTML/XLS/XML formats and does not work separately from the /report:<filepath> key. |
/log |
/log:<filepath> Generates comparison log file in a specified directory. The following example shows how to compare schemas using settings from the file and write log to the specified file: C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /schemacompare /compfile:"OSC1vsOSC2.scomp" /log:"D:\sync.log |
/groupby |
/groupby:<none/status/objecttype> Groups objects in such report. The following example shows how to compare schemas using settings from the file, generate comparison report, and group objects in the report by type: C:\Program Files\Devart\dbForge Studio for SQL Server>dbforgesql.com /schemacompare /compfile:"OSC1vsOSC2.scomp" /report:"report.txt" /reportformat:HTML /groupby:objecttype |
Usage examples
- Compare databases using settings from a file saved earlier:
/schemacompare /compfile:"D:\workDir\SC1vsSC2.scomp"
- Compare and synchronize schemas using connection through the client. Log will be written to the specified file:
/schemacompare /source server:SqlServer1 user:yourusername password:yourpassword database:db1 /target server:SqlServer2 user:yourusername password:yourpassword database:db2 /sync /log:"D:\sync.log"
- Compare specified databases and save the synchronization script to the D:\compare_result.sql file:
/schemacompare /source server:SqlServer1 user:yourusername password:yourpassword database:db1 /target server:SqlServer2 user:yourusername password:yourpassword database:db2 /sync:"D:\compare_result.sql"
- Compare and synchronize databases using settings from the file, ignore case and foreign keys during comparison; generate a report to the specified file in the html format:
/schemacompare /compfile:"SC1vsSC2.scomp" /icase:yes /IgnoreForeignKeys:yes /report:"report.txt" /reportformat:HTML /groupby:objecttype /incsettings:T /sync
Note
To build the command-line syntax, it’s better to use the Command-line Wizard.
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.