DBLense Compare — User Guide
Visual schema and data comparison between two SQL Server databases. Generate synchronization scripts automatically with a side-by-side diff viewer.
Getting Started
Double-click DBLenseCompare.exe — no installation required. The interface is divided into source (left) and target (right) connection panels.
Setting Up Source & Target
- Click Connect on the Source (left) panel
- Enter your source server details and select the database
- Click Connect on the Target (right) panel
- Enter your target server details and select the database
All four authentication modes are supported: Windows, SQL Server, Azure Entra ID (Password), and Azure Entra ID (MFA).
Schema Comparison
Click Compare Schema to analyze structural differences between the two databases. DBLense compares:
Object Types Compared
- Tables — Columns, data types, nullability, defaults, computed columns, identity settings
- Indexes — Clustered, non-clustered, unique, filtered indexes, included columns
- Constraints — Primary keys, foreign keys, check constraints, unique constraints
- Views — Definition, referenced tables
- Stored Procedures — Full procedure body comparison
- Functions — Scalar, table-valued, inline functions
- Triggers — DML and DDL triggers
- Schemas — Schema ownership and permissions
Comparison Results
Objects are categorized as:
- ● Equal — Identical in both databases
- ● Different — Exists in both but has changes
- ● Only in Source — Missing from target
- ● Only in Target — Missing from source
Data Comparison
Compare actual data between matching tables:
- Select tables to compare (or use Select All)
- Click Compare Data
- Results show row-level differences: inserts, updates, and deletes needed to sync
Data comparison uses primary key or unique constraint columns to match rows between databases. Tables without a key column can use all columns for matching.
Visual Diff Viewer
Click any different object to open the side-by-side diff view:
- Left panel = Source definition
- Right panel = Target definition
- Highlighted lines show exact changes
- Green lines = Additions
- Red lines = Deletions
- Yellow lines = Modifications
This makes it easy to visually understand what changed between two environments.
Synchronization Scripts
After comparison, generate T-SQL scripts to synchronize the target database with the source:
- Select the objects you want to synchronize (checkboxes)
- Click Generate Script
- Review the generated T-SQL
- Copy to clipboard or Save to file
- Execute in SSMS or your preferred tool
Scripts handle dependency ordering automatically (e.g., tables before foreign keys, schemas before objects).
Filtering & Search
- Object type filter — Show only tables, views, procedures, etc.
- Status filter — Show only Different, Only in Source, Only in Target
- Search — Find objects by name
- Schema filter — Limit comparison to specific schemas (e.g., dbo only)
Typical Workflows
Deploy Development Changes to Staging
- Connect Dev database as Source, Staging as Target
- Run Schema Compare
- Review differences — select only the objects you want to deploy
- Generate sync script
- Review and execute on Staging
Audit Production vs. DR
- Connect Production as Source, DR as Target
- Run both Schema Compare and Data Compare
- Verify no drift between environments
- Generate a report of any differences
Post-Deployment Validation
- Before deployment: Compare source → target and save results
- After deployment: Compare again and verify all differences resolved
System Requirements
| Component | Requirement |
|---|---|
| OS | Windows 10/11 or Windows Server 2016+ |
| Runtime | .NET 8.0 (or self-contained package) |
| SQL Server | SQL Server 2016+ |
| Azure | Azure SQL Database, Azure SQL Managed Instance |
| Permissions | Read access to sys.objects, INFORMATION_SCHEMA, sys.sql_modules |
| Installation | None — single portable .exe |