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

Dragging schema SQL

Top  Previous  Next

An easy way to generate SQL for the whole schema or specific parts of it is just to drag the relevant nodes of the schema tree to any text editor understanding OLE drag-n-drop. Several nodes of the schema tree can be selected by holding Ctrl or Shift keys, as usually.

The SQL code dropped into the target window depends on whether you are viewing one or two databases, on the combination of Shift, Control and Alt keys and on the target window itself. This might sound complicated, but in fact the logic was designed to be very simple and intuitive, so most of the time you are getting just the right kind of SQL with minimal mental efforts. And all the time you are dragging the data, one of the special drag cursors indicates the operation to be performed.

One database is open, there is no comparison. When you drag&drop, the resulting script would either CREATE or DROP the selected objects. By default, CREATE statements would be generated. Holding any of the SHIFT, CTRL or ALT key switches to DROP statements:

Keys

Cursor

Action

 

csr_create_l

Generate CREATE statements

[Shift], [Ctrl] or [Alt]

csr_drop_l

Generate DROP statements

Comparing two databases. When you are viewing the merged results of comparing two databases, the drag&drop can produce the CREATE, DROP or the difference SQL for the selected item(s). Besides, you can choose either of the databases for CREATE/DROP or choose the direction of synchronization for diff scripts. This gives you 6 combinations:

Keys

Cursor

Action

Reversed action

(with [Shift] key pressed)

Cursor

 

 

csr_create_l

Generate CREATE statements from the left-hand database schema

Generate CREATE statements from the right-hand database schema

csr_create_r

[Ctrl]

csr_diff_r

Generate difference script to be applied to right-hand DB to synchronize it with the left-hand one.

Generate difference script to be applied to left-hand DB to synchronize it with the right-hand one.

csr_diff_l

[Alt]

csr_drop_l

Generate DROP statements from the left-hand database schema

Generate DROP statements from the right-hand database schema

csr_drop_r

Dropping to Code Viewer window. If there is no connection selected in the Target combo box, the drag&drop operates as described above. Otherwise, the currently selected Target is taken into consideration. Note that certain combinations in the table below are grayed out. It means that sending that kind of SQL to that target connection does not make sense and/or might not work (like applying "CREATE" SQL to either of the DBs being compared):

Keys

Cursor

Action

Reversed action

(with [Shift] key pressed)

 

csr_diff_r or csr_diff_l

Generate difference script to be applied to the DB selected in the Target combo-box to synchronize it with the other database.

Generate difference script to be applied to the other DB to synchronize it with the selected one.

[Alt]

csr_drop_l or csr_drop_r

Generate DROP statements from the database selected in the Target combo-box

Generate DROP statements from the other database

[Ctrl]

csr_create_l or csr_create_r

Generate CREATE statements from the other database schema.

Generate CREATE statements from the selected database schema

When some SQL is dropped to the CodeView without a selected target, the selection is made automatically, if possible:

Operation

New target

csr_diff_l or csr_drop_l

Left-hand database

csr_diff_r or csr_drop_r

Right-hand database

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