DBLense Script Runner — Complete User Guide

Execute SQL scripts across multiple servers and databases in one click. Run scripts sequentially, in parallel, or in batches — then export results to Excel or CSV. All from a single portable .exe.

Getting Started

  1. Create a Server Group — Click in the Server Groups toolbar. Enter a name like "Production" or "Dev/Test".
  2. Add Servers — Click + Add Server. Enter your server details and test the connection.
  3. Load Databases — Select target servers, then click Load Databases.
  4. Write or Load a Script — Type SQL in the editor tab, or switch to Script Folder tab.
  5. Execute — Click ▶ Execute and watch results stream in.

Server Group Management

Creating Groups

Groups are organizational containers — create groups like "Production Servers", "Staging", "Azure SQL", or "DR Cluster".

Adding Servers

FieldDescription
Server NameFull server/instance name (e.g., SQLPROD01, myserver.database.windows.net)
Display NameOptional short label. Useful for long Azure MI names. Full name visible as tooltip.
AuthenticationChoose from four modes (see below)
Login / PasswordRequired for SQL and Entra ID auth modes

Click Test Connection to verify connectivity before saving.

Selection Controls


Authentication Modes

ModeUse CaseFields Required
Windows AuthenticationDomain-joined on-premises serversNone — uses Windows credentials
SQL Server AuthenticationSQL login/password accessLogin + Password
Entra ID (Password)Azure SQL with Entra credentialsLogin + Password
Entra ID (MFA)Azure SQL with multi-factor authLogin only (interactive)

Passwords are encrypted using Windows DPAPI — they are never saved as plain text.


Script Editor

Type or paste SQL directly into the built-in editor with:

Script Folder

Run multiple .sql files from a folder:

  1. Click Browse... and select a folder
  2. All .sql files are listed with checkboxes, filename, and file size
  3. Use Select All / Deselect All to toggle
  4. Scripts are listed alphabetically (top-level only, no subfolder recursion)

Target Databases

After selecting servers, click Load Databases. Three quick filters:

FilterSelects
AllEvery database on the server
User (default)Only user databases (excludes master, model, msdb, tempdb)
SystemOnly system databases
If no databases are loaded for a server, execution falls back to the master database.

Execution Modes

ModeBehaviorBest For
Sequential (default)One target at a time, in orderData-modifying scripts, first-time runs
ParallelALL targets concurrentlyRead-only queries across many servers
BatchedGroups of N (configurable), batch by batchBalanced speed & resource control

Error Handling

ModeBehavior
Continue on Error (default)Proceeds through all targets, logs failures
Stop on ErrorHalts remaining work after first failure

GO Batch Splitting


Results

Script Results Tab

All result rows merged into a single data grid with two auto-prepended columns: Instance Name and Database Name. Supports sorting and column resizing.

Execution Summary Tab

ColumnDescription
Status✓ (success) or ✗ (failure)
ScriptScript filename (folder mode)
Group / Server / DatabaseTarget details
RowsRows returned or affected
DurationExecution time
ErrorError message (if failed)

Execution Log Tab

Timestamped, auto-scrolling log with 🔵 Info, ✅ Success, ❌ Error, and 🛑 Stop messages.


Exporting Results

Excel Export

CSV Export

UTF-8 CSV with proper escaping. Data rows followed by an Execution Summary section.


Practical Workflows

Quick Ad-Hoc Query Across All Servers

  1. Check all server groups → Load Databases → Select User databases
  2. Type query in Script Editor
  3. Set Execution Mode to Parallel
  4. Execute → Export to Excel (Single Sheet)

Run Migration Scripts in Order

  1. Create folder with sequentially named scripts (001_AddColumn.sql, 002_UpdateData.sql)
  2. Script Folder tab → Browse → Select scripts
  3. Set Sequential mode + Stop on Error
  4. Execute

Security Compliance Check

  1. Place compliance scripts in a folder
  2. Select all servers and databases
  3. Run with Sequential + Continue on Error
  4. Export to Excel for review

Data Storage & Security

ItemDetails
Configuration file%LOCALAPPDATA%\DBLenseScriptRunner\servergroups.json
Password encryptionWindows DPAPI (CurrentUser scope)
Auto-saveEvery group/server change saved automatically
No telemetryNo data sent externally. All operations are local.

System Requirements

ComponentRequirement
OSWindows 10/11 or Windows Server 2016+
Runtime.NET 8.0 (or self-contained package)
SQL ServerSQL Server 2016+
AzureAzure SQL Database, Azure SQL Managed Instance
InstallationNone — single portable .exe