SQL Data Compare - 10.0
Command line basics - SQL Data Compare
This topic provides information on the following aspects of the SQL Data Compare command line:
- Getting help
- Entering a command
- Aliases
- The /Options switch
- Verbose and quiet switches
- Redirecting command line output
For details and examples of all of the switches that are available for the SQL Data Compare command line, see Switches used in the command line
Getting help
To display a brief description of SQL Data Compare, and basic help on all the command line switches, enter:
sqldatacompare /Help
For more detailed help enter:
sqldatacompare /Help /Verbose
This displays a detailed description of each switch and the values it can accept (where applicable), and all exit codes.
To output the help to an HTML file, specify a file name and path:
sqldatacompare /Help /Verbose /Html > C:\SQLDataCompare8_Help.htm
Entering a command
When you enter a command, the order of switches is unimportant.
You are recommended to follow the Microsoft convention of separating a switch from its values using a colon as shown below.
/Out:Output.txt
Values that include spaces must be delimited by double quotation marks ( " ). For example:
/Out:"c:\output file.txt"
Note that if you delimit a path with double quotation marks, you must not terminate the path with the backslash character ( \ ), because the backslash will be interpreted as an escape character. For example:
For switches that accept multiple values, use commas to separate the values. For example:
/Options:IncludeDependencies,ForceColumnOrder
For switches that accept a compound value, separate each part of the value using a colon.
For example, the /include and /exclude switches are used to include and exclude objects from the comparison and synchronization:
/Include:Table:Product
This includes all tables for which the table name contains the word Product.
Note that if you use the /include switch to compare only tables (or any object type) matching a word or regular expression, all other objects not of that type will still be included in the comparison. In the above example, only tables that contain the word Product will be included, but all views, stored procedures, users and so on will still be included, unless further arguments to limit these object types are also specified.
Aliases
Many of the switches have an alias. The alias provides a convenient short-hand way to specify the switch. For example, /? is the alias for the /help switch, and /v is the alias for the /verbose switch.
Switches and aliases are not case sensitive.
The /Options switch
You can use the /Options switch to change your options. For example, comparisons are not case-sensitive by default; to specify case sensitive comparisons you would use the /options switch:
/Options:CaseSensitiveObjectDefinition
However, note that if you set any options explicitly, all of the default options are switched off.
For more information about options, and a list of default option settings, see Options used in the command line
Verbose and quiet switches
The standard output mode prints basic information about what the tool is doing while it is executing. You can specify verbose and quiet modes using the /verbose and /quiet switches, respectively. In verbose mode, detailed output is printed; in quiet mode, output is printed only if an error occurs.
Redirecting command line output
The command line output can be redirect using either the /out switch, or the output redirection features provided by the shell in which you are executing the command.
Using /out
You can use the /out switch to specify the file to which you want output directed:
sqldatacompare ... /Out:outputlog.txt
where outputlog.txt is the name of the file. If the file exists already, you must also use the /force switch to force the tool to overwrite the file, otherwise an error will occur.
Other redirection
From the standard command prompt provided by Windows, you can redirect output to a file as follows:
sqldatacompare ... > outputlog.txt
Note that the redirection operator ( > ) and file name must be the last items on the command line.
If the specified file exists already, it will be overwritten. To append output from the tool to an existing file, enter the following:
sqldatacompare... >> existinglog.txt
This adds the output to the existing file content, without data being lost.
If you are scripting using a language such as VBScript, JScript, PHP, Perl, or Python, or if you want to access the tool from Web pages using ASP.NET, refer to the documentation for the language.
Specify command line arguments in an XML file that can be referenced using the /argfile switch. For more on this topic see Using XML to specify command line arguments
See also |
Was this article helpful?
SQL Data Compare
- Logging and log files
- Internal Connection Fatal Error in versions 4 and 5
- NULL textptr passed to UPDATETEXT function when running synchronization
- How much free hard disk space is required?
- Comparing the data of two tables in the same database
- Suggestions to combat comparison and synchronization performance issues
- SQL comparison and synchronization automation capabilities
- SqlNullValueException occurring in synchronization wizard
- SQL Data Compare command-line XML argument file examples
- Using Windows authentication logons between domains
- Using a filter on a column on related (joined) tables
- Determining minimum database permissions for SQL Data Compare
- Tables with compound keys may not be mapped automatically
- Best practices for synchronizing data
- Cleaning up a SQL script after SQL Compare or SQL Data Compare
- Troubleshooting System.OutOfMemoryException during comparison
- Exception thrown by db reader 1
- Reseed applying "incorrect" identity values
- Running migration scripts using SqlCmd.exe
- This SQL Server has been optimized for x concurrent queries.
- SQL Data Compare showing differences in 2 identical databases
- How to force SQL Compare and SQL Data Compare to use an Encrypted Connection
- Improving the performance of SQL Data Compare
- Logging and log files
- Case-sensitive comparisons
- Tables or views that could not be compared
all SQL products
- Compatibility of Red Gate tools in 64-bit environments
- Application has encountered an error and needs to close
- Error message after installing SQL Toolbelt - The description for Event ID ( 1 ) in Source ( nview_info ) cannot be found.
- Changing the temporary directory used by the installer
- Toolbelt Installer "hanging" while "scanning volumes"
- Login failing with "trusted SQL Server connection" error when using RunAs
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
SQL Data Compare
- Activating your products
- Activating your products
- Getting help offline
- Getting better performance out of SQL Data Compare
- Release notes - version 10.xx
- SQL Data Compare release notes - version 7.xx
- SQL Data Compare release notes - version 8xx
- SQL Data Compare release notes - version 9.xx
all SQL products
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs

Using SQL Data Compare