Interface & Features — Compare

Walk through the main screens, tabs, and controls you will use day to day.

Schema Comparison

With both databases connected, stay on the Schema Compare tab and click Compare Schema. DBLense loads catalog metadata from both sides and classifies each object.

Object Types Compared

  • Tables — presence and high-level table definition
  • Columns — type, nullability, identity, and related column metadata (shown with parent table)
  • Indexes — clustered / non-clustered / unique / filtered definitions
  • Constraints — primary key, unique, foreign key, and check constraints
  • Views — module definition
  • Stored Procedures — full procedure body
  • Functions — scalar and table-valued definitions
  • Triggers — DML trigger definitions

Result Statuses

  • Equal — identical after whitespace-normalized compare
  • Modified — exists on both sides with different definitions
  • Source Only — missing on target
  • Target Only — missing on source

Use the filter box and Equal / Modified / Source Only / Target Only checkboxes to focus the grid. Select the objects you want included in a sync script.


Data Comparison

  1. Open the Data Compare tab
  2. Click Discover Tables to pair tables by schema.table name on both sides
  3. Choose a scope: All matched, Selected (checked rows), or Single (highlighted row)
  4. Optionally open Options for hash compare, date-column filter, batch size, and parallelism settings
  5. Click Compare Data

Rows are matched using primary keys when available, otherwise unique indexes or smart-detected key columns. Results summarize Equal / Updates / Inserts / Deletes and list differing keys (capped per table for UI performance).

Large tables can use hash-based compare for speed. For full UPDATE scripts with column SET lists, disable hash compare in Options so the engine captures per-column values.

Definition Viewer

On Schema Compare, select any row to open the side-by-side definition panes:

  • Left — Source definition
  • Right — Target definition

Status badges in the grid show Equal, Modified, Source Only, or Target Only at a glance. Parent table names appear for columns, indexes, constraints, and triggers.


Synchronization Scripts

After a compare, open the Sync Script tab (or click Generate — it switches you there):

  1. For schema: check the objects to include, then Generate Script
  2. For data: run Data Compare first, then Generate Script to script inserts / updates / deletes across compared tables
  3. Copy to Clipboard or Save to File… (.sql)
  4. Review in SSMS / Azure Data Studio before executing on target

Schema scripts emit CREATE / ALTER for modules (procedures, views, functions, triggers) and documented comments for structural objects that need manual review (tables, columns, indexes, constraints). Data scripts wrap statements in a TRY/CATCH transaction.

⚠️ Always review sync scripts before executing against production. Back up the target database first. Scripts make the target match the source.

Filtering & Search

  • Schema filter text — match object name or type label
  • Status filters — Equal, Modified, Source Only, Target Only
  • Data table filter — schema or table name
  • Match filters — Matched, Source only, Target only table pairs
  • Select All / Select None — control which rows are included in scripting or data compare scope