Contents 

AdeptSQL Diff Reference
AdeptSQl Diff versions, history and milestones
Supported versions of MS SQL Server
Getting started
Connecting to databases
Scanning available servers
Saving and opening comparisons
Running from command line
Diff in portable mode
Working with the schema
Viewing schema differences
Ignored Differences
Comparing objects side-by-side
Dragging and dropping schema items
Using schema filters
Generating comparison reports
Customizing the reports
Executing the SQL
SQL errors and warnings
Transaction support
Keyboard shortcuts
Editing commands and keyboard shortcuts
Using keyboard templates
Choosing debugger's key mapping
Comparing table data
DataDiff overview
DataDiff configuration dialog - table-level
DataDiff configuration dialog - columns
Special situations comparing data
Exporting data to Excel
DataDiff Reports
Column configuration file
Configuring AdeptSQL Diff
Options dialog
Schema Scan
Selective Loading
Comparison
Name Comparison
Code Comparison
User-defined types
Indexes and Statistics
Permissions and XProps
Synonyms
Other details to ignore
Scripting
General logic
Side-by-side scripting
Formatting
Identifiers
Schema Level
Tables
Constraints
Default Values
Procedures, Views, etc
Visuals
Text Fonts
Schema Tree
Summary collections
Side-by-Side View
Suppressed dialogs
Data comparison options
General
Scripting
Column Config File
Using COM Automation interface
Automating schema comparison
Automating data comparison
Licensing and contact info
Registration of AdeptSQL Diff
License conditions
Contact information

AdeptSQL Diff Online Help

Prev Page Next Page

Command-line parameters and option storage.

Top  Previous  Next

Specifying a comparison project on the command line.

Starting from version 1.90, AdeptSQL Diff supports a number of start-up parameters on the command line. The parameter you'd most commonly use is a comparison project's filename. A comparison file (filename.ASQ) contains all connection information and settings the Diff needs to start comparing two databases (you might need to supply the passwords, though), so when you specify it in the command line, the Diff will run the comparison immediately:

asqldiff c:\my_comparison.asq

When the Diff gets installed, it registers itself as the application to open .ASQ files. Therefore to re-run a saved comparison, you can simply click a comparison document in a File Explorer window.

The Diff also recognizes several command-line switches. Since most of the switches control loading and saving of the Diff's options, let's first look where the Diff keeps its configuration.

Storing options in file or registry; "portable" mode.

Starting from version 1.90, AdeptSQL Diff can keep its configuration in .INI files as well as in the system registry. Please note that the format of Diff options in the registry has changed and is not backward-compatible with Diff versions prior to 1.90. The program will NOT read the old settings, so even if you have an earlier version, you'll have to configure the new one again.

When the Diff starts (without any command line switches modifying its behaviour), it first tries to locate a file called ASQLDIFF.INI in the same directory the executable is running from. If such file exists, the settings it contains are loaded. After that, the Diff checks if another set of options exists in the system registry. If it does, whatever is in the registry overrides the settings from the ASQLDIFF.INI file.

When the program is closing, it writes its modified configuration back to the registry, or if the registry key for AdeptSQL Diff doesn't exists, back to the INI file. The Diff won't write its configuration to both places at once and it won't write to the registry if no Diff keys existed before.

The reasoning behind such behaviour is as follows. The configuration file ASQLDIFF.INI is included in the setup and supposed to contain some "original" or "default" option set. It is normally not overwritten when the program exits. The registry entry for AdeptSQL Diff is created when the program is installed and works as the regular option storage. All changes you make are normally saved there.

However, it is anticipated that the Diff can also be used in "portable" mode, when it is not actually installed on a system, but is run directly from a removable media, like AdeptSQL Toolkit flash drive. In this case there will be originally no registry key for AdeptSQL Diff and none will be created as a result of running the program, so the system remains "clean". All options will be both loaded from and saved to the default .INI file.

Command-line switches.

The command-line switches can be placed either before or after the document name and must start with '/' or '-'. The switches are case-insensitive, some of them have several alternative spellings (e.g. '-i' or '-ini'). Some of them can be optionally followed by an INI file name, which must not be confused with the comparison document parameter described above (so you must NOT specify "-i", "-ri" or "-wi" directly before the document name).

The following switches are supported:

-i|-ini [ini_file]

Forces the Diff to read configuration from and save it to the default or specified .INI file, even if the registry entry is present. This works as a shortcut for the combination of -ri and -wi switches described below.

-ri [ini_file]

Forces the Diff to read configuration from the default or specified .INI file. Does not affect saving the changed options on exit.

-wi [ini_file]

Forces the Diff to write configuration to the default or specified .INI file. Does not affect loading the options on startup.

-reg

Forces the Diff to create a registry entry for the product, if it didn't exist before. Therefore on exit the Diff would write its configuration to the registry, according to the rules described above. While the switch doesn't exactly conflict with -ini or -wi switches, it doesn't make much sense to use them together. On the other hand, the combination of "-ri [ini_file] -reg" would have an effect of copying all settings from the INI file to the registry.

-nc or

-nocompare

This switch can be used when you also specify a comparison file to tell the Diff that all comparison configuration should be loaded, but the comparison is not to be  started automatically. This allows you to change the connection parameters of the loaded comparison before pressing [Compare]

Environment settings vs. project-level settings.

There is currently no overlap between "project options" (those specific to a particular comparison and saved in a .ASQ file) and "environment options" (saved to registry or .INI file as described above). The project-level settings include the connection parameters plus any schema-loading filters, renaming associations and DataDiff settings for specific tables. All the rest - any settings that are available through the Options dialog (e.g. scripting styles) are considered "environment-level" and not saved with the project. It is possible that future versions would allow to redefine some of these setting on the project level as well, but no such functionality has been implemented so far.

Meanwhile, if you really need different option sets for different comparisons, use the command-line switches described above to start the Diff with different configuration files according to the comparison you are going to work with:

asqldiff -i c:\my_options.ini c:\my_comparison.asq

   
Converted from CHM to HTML with chm2web Standard 2.85 (unicode)