Interface & Features — SQL Server Compare

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

Saved Connections

The sidebar is the list of SQL Server instances for this PC. + Add Server tests a connection and saves it. If Source or Target is still empty, the new instance fills the first empty side. The button at the bottom collapses the sidebar to icons.

  • Use as Source and Use as Target assign the selected row
  • File → Manage Connections… lists every saved instance and is where you edit or delete one. Deleting a connected instance clears that side
  • Schema, Data, and Config each have Source and Target cards: a connection dropdown bound to the saved list, plus a database dropdown that enables after the instance connects
  • File holds Add Server, Manage Connections, Connect Source, Connect Target, Dark Theme, Documentation, Send Feedback, and About
  • Tools → Compare Options… opens data-compare depth and row filters

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. The badges on this tab (equal, modified, source only, target only) count schema objects only. They are not the data-compare totals.

Schema Compare grid filtered to differences, with source and target definitions for a stored procedure

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, the Status list (All statuses, or Equal, Modified, Source Only, and Target Only together), the Type list, and the Object list. Selecting a row does not change the Object filter. Check the objects you want in a bulk script. Schema for target and Schema for source sit on this tab. A row’s For target and For source script that object, and a table also includes its keys and indexes.


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 paired, Selected (checked rows), or Single (highlighted row)
  4. On the bar under Discover Tables, pick a depth. The default is Column values (full). Row counts only and Column values (hash) are faster. Choosing either one reminds you that a sync script needs Column values (full). Optional date filters sit on the same bar. Tools → Compare Options… opens the same choices.
  5. Click Compare Data

Rows are matched using primary keys when available, otherwise unique indexes or detected key columns. The RESULTS strip on this tab (Equal, Updates, Inserts, Deletes) updates only after a data compare. It does not repeat the schema badges. Per-table outcome is in the Last result column. Differing keys are listed below the strip.

Data Compare filtered to dbo.AWBuildVersion, with paired row counts and a separate results strip
Large tables can use hash or row counts for speed. For UPDATE scripts with column SET lists, keep Column values (full).

Definition Viewer

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

  • Left — full source script
  • Right — full target script

Unchanged lines stay plain. Changed lines are tinted, and the changed tokens are highlighted more strongly. Keywords, data types, functions, strings, comments, and numbers use the same T-SQL colors as Script Runner. SQL Server-generated key names that differ only by their suffix are treated as equal when the definition matches. Parent table names appear for columns, indexes, constraints, and triggers.


Server and Database Configuration

Open the Config Compare tab. It uses the same source and target connections as schema and data compare.

  • Instance configuration — server properties (version, edition, collation, HADR, and related SERVERPROPERTY values) and every sp_configure option, compared by the value that is running. A database selection is not required.
  • Database configuration — the databases selected on this tab. This includes database options (recovery model, compatibility level, snapshot isolation, Query Store, and the ANSI settings), database scoped configuration, and data/log file size, growth, max size, and path.

The two scopes do not share a result grid. Choosing the other radio clears the previous rows and starts that compare. Badges on this tab are separate from schema and data.

Config Compare on Instance configuration, listing server properties and sp_configure values for both SQL Servers

Differences are checked by default. Select a row to see the T-SQL that would make the target match the source, or a note when the setting is informational only (edition, collation, file path, TDE, CDC).

Database configuration filtered to Recovery model, showing FULL on the source and SIMPLE on the target, with the ALTER DATABASE script for the selected row

Config for target writes the selected differences. Config for source reverses the direction. The script uses sp_configure plus RECONFIGURE for server options, ALTER DATABASE for database options and file growth, and ALTER DATABASE SCOPED CONFIGURATION for scoped settings. Settings that need a restart, and settings that are not changed automatically, are called out in comments. Review the script before you run it.


Reports, source control, and CI

Export Report saves the current compare as HTML, Excel (.xlsx), XML, PDF, or CSV. Use it from Schema Compare, Data Compare, Config Compare, or the Sync Script tab. The Sync Script export includes every compare you have already run.

Scripts Folder writes sync.sql and one .sql file per changed schema object. Commit that folder with Git, Azure Repos, or GitHub. Compare does not push commits or talk to a Git host itself.

The same exe runs from a pipeline. Open a trial in the app once on that machine, then call:

DBLenseCompare.exe compare --mode schema --source-server localhost --source-database AppDb --target-server localhost --target-database AppDb --report compare.html --scripts-folder schema
  • --mode schema|data|config
  • --report file ending in .html, .xlsx, .xml, .pdf, or .csv
  • --depth counts|hash|full for data compare. Counts is the default.
  • --config-scope instance|database

Exit code 0 means no differences, 1 means differences were found, and 2 means the compare failed. A pipeline can fail the job when the exit code is 1. A sample workflow is in DBLenseCompare/ci/github-actions-compare.yml.

Sync Script tab after Generate Config Script, with Export Report and Scripts Folder on the toolbar and an ALTER DATABASE statement in the editor

Synchronization Scripts

The Sync Script tab stays faded until a script exists. Generate it from the compare tab, and the tab opens with T-SQL coloring:

  1. Schema for target or Schema for source — checked schema objects that are not equal. Modules (procedures, views, functions, triggers) get CREATE or ALTER. A modified table gets ALTER TABLE ... ADD and ALTER COLUMN. A column that exists only on the side being changed is left as a commented DROP. A single row’s For target / For source scripts that object, and a table includes its keys and indexes.
  2. Data for target or Data for source — inserts, updates, and deletes from the data compare. For full UPDATE column lists, use Column values (full). Row buttons in the results grid script one change.
  3. Config for target or Config for source — selected server or database configuration differences.
  4. Copy to Clipboard, Save to File… (.sql), Export Report, and Scripts Folder stay on the Sync Script tab
  5. Review in SSMS or Azure Data Studio before executing. For target is meant to run on the target so it matches the source. For source is the reverse.
Sync Script tab with a generated schema script. The tab bar includes Config Compare, and the toolbar includes Generate Config Script, Export Report, and Scripts Folder
⚠️ 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, Type, and Object — schema status can combine Equal, Modified, Source Only, and Target Only. Type covers tables, views, procedures, functions, triggers, indexes, keys, columns, partitions, and filegroups. Object limits the grid to one name. All three default to everything
  • Data table filter — schema or table name
  • Pairing filters — Paired, Source only, Target only tables
  • Select All / Select None — control which rows are included in scripting or a Selected data compare

Log

The Log tab records the session in order: instance connected, database selected, swap, schema totals, table discovery, data compare, and script generation. Clear Log empties the list. The status bar along the bottom repeats the latest step.

Compare Log tab listing connection, schema compare, discovery, and data compare messages

Light and Dark Theme

File → Dark Theme switches the window immediately and remembers the choice. Light theme uses a light gray title bar and dark text. Colored actions — Add Server, Compare Schema, Compare Data, and the script buttons — keep white labels in both themes.

DBLense SQL Server Compare in dark theme on the Log tab