Extension: SqlLens SQL Server Tools · Publisher: sqllens · Version 0.0.2+
Install: Visual Studio Marketplace
The SqlLens VS Code extension brings SQL Server dependency analysis directly into your editor workflow. Analyze stored procedures, views, functions, and tables without leaving VS Code — and connect to the same SqlLens account you use in the Desktop application.
Note: The VS Code extension and the Desktop application share the same account and server connections. Features unique to the Desktop (Mermaid diagrams, AI code review, database compare, Agent Jobs) are listed in the Feature Comparison.
Ctrl+Shift+X)Recommended: Install SQL Server (mssql) to enable right-click dependency analysis from the mssql Object Explorer.
| Command | Notes |
|---|---|
SqlLens: Analyze Dependencies from mssql Object Explorer |
Requires mssql extension + live SQL connection context |
SqlLens: Connect to SQL Server |
Local command flow |
SqlLens: Search Across Databases |
Placeholder/limited flow in current build |
SqlLens: Test mssql Extension Integration |
Diagnostic command |
SqlLens: Open Help |
Opens this guide |
| Command | Notes |
|---|---|
SqlLens: Analyze Dependencies |
Server Explorer flow with selected environment |
SqlLens: Analyze SQL Object Dependencies |
Currently gated by login + environment |
SqlLens: Search Objects |
Requires selected environment/server context |
SqlLens: Compare Database with Git |
Requires mapping + cloud services |
SqlLens: Configure GitHub PAT |
Cloud credential flow |
SqlLens: Manage GitHub Mappings |
Cloud mapping flow |
SqlLens: Configure Batch Review Notifications |
Cloud automation flow |
SqlLens: Select Environment |
Cloud environment management |
SqlLens: Create New Environment |
Cloud environment management |
SqlLens: Add Server |
Cloud environment management |
SqlLens: Remove Server |
Cloud environment management |
SqlLens: Update Server Password |
Cloud + Key Vault path |
SqlLens: Check Key Vault Credentials |
Cloud diagnostic path |
| Command | Notes |
|---|---|
SqlLens: Login |
Sign in |
SqlLens: Register |
Create account |
SqlLens: Logout |
Sign out (when logged in) |
SqlLens: Show User Info |
Shows session/account status |
Open Command Palette (Ctrl+Shift+P):
SqlLens: Login
Sign in is required for cloud features (environments, GitHub mapping/PAT, compare, batch review).
For guest/local flows, you can skip sign-in and start from mssql Object Explorer analysis.
SqlLens: Add Server
| Field | Example |
|---|---|
| Server name | localhost or .\SQLEXPRESS |
| Database | MyDatabase |
| Username | sa (SQL auth) |
| Password | your password |
Click the SqlLens icon in the Activity Bar (left sidebar) to open the Server Explorer panel. Expand a server to browse databases and objects.
▶ localhost
└── MyDatabase
├── Stored Procedures
│ └── dbo.GetOrderSummary [graph icon]
├── Views
│ └── dbo.vw_ActiveOrders [graph icon]
├── Functions
│ └── dbo.fn_FormatDate [graph icon]
└── Tables
└── dbo.Orders [graph icon]
Toolbar:
Right-click a database: Search Objects · Compare with Git
Right-click a stored procedure / view / function / table: Analyze Dependencies
Three ways to trigger:
1. From Server Explorer
Right-click any stored procedure, view, function, or table → Analyze Dependencies
2. From mssql Object Explorer
Right-click any object in the mssql extension tree → SqlLens: Analyze Dependencies from mssql Object Explorer
(Supports: Tables, Views, Stored Procedures, Scalar Functions, Table-Valued Functions. Use SQL Login for this flow.)
3. From SQL editor selection
Highlight an object name in any .sql file → right-click → SqlLens: Analyze SQL Object Dependencies
(File must be .sql or mssql language and have an active selection)
SqlLens: Search Across Databases
Searches all databases on the connected server simultaneously. Results show database, schema, object name, and type. Also accessible via the 🔍 toolbar icon or right-click on a database node.
SqlLens: Compare Database with Git
Diffs stored procedure definitions in your live database against versions committed in your mapped Git repository. Shows added, modified, and deleted objects. Requires GitHub PAT and a server → repo mapping (see Git Setup below).
SqlLens: Configure Batch Review Notifications
Schedule automated AI analysis jobs on a set of SQL objects. Configure frequency, target objects, and notification preferences. Results are delivered as VS Code notifications.
SqlLens: Explore GitHub Repo Structure
Browse the folder and file tree of your mapped GitHub repository from inside VS Code.
SqlLens: Configure GitHub PAT
Enter a GitHub Personal Access Token with repo scope. Required for Compare with Git, Explore Repo Structure, and Batch Review.
SqlLens: Manage GitHub Mappings
Map each SQL Server instance to a GitHub repository (ServerName → owner/repo-name).
Organize servers by environment (Development, Staging, Production):
| Command | Description |
|---|---|
SqlLens: Select Environment |
Switch active environment |
SqlLens: Create New Environment |
Add a new environment |
File → Preferences → Settings → search SqlLens:
| Setting | Default | Description |
|---|---|---|
sqllens.azureFunctions.baseUrl |
https://sqllens-functions.azurewebsites.net |
Backend API URL |
sqllens.azureFunctions.functionKey |
(empty) | API key (from account registration) |
sqllens.connections |
[] |
Saved SQL Server connections |
| Command | Description |
|---|---|
SqlLens: Login |
Sign in |
SqlLens: Register |
Create account |
SqlLens: Logout |
Sign out |
SqlLens: Show User Info |
Display account details |
SqlLens: Add Server |
Add SQL Server connection |
SqlLens: Remove Server |
Remove saved connection |
SqlLens: Update Server Password |
Update credentials |
SqlLens: Connect to SQL Server |
Select active connection |
SqlLens: Select Environment |
Switch environment |
SqlLens: Create New Environment |
Add environment |
SqlLens: Analyze Dependencies |
Analyze object from Explorer |
SqlLens: Analyze Dependencies from mssql Object Explorer |
Analyze object from mssql Object Explorer |
SqlLens: Analyze SQL Object Dependencies |
Analyze highlighted SQL in editor |
SqlLens: Search Across Databases |
Cross-database search |
SqlLens: Compare Database with Git |
Diff live DB vs Git |
SqlLens: Configure GitHub PAT |
Set GitHub token |
SqlLens: Manage GitHub Mappings |
Map servers to repos |
SqlLens: Configure Batch Review Notifications |
Schedule AI review |
SqlLens: Explore GitHub Repo Structure |
Browse mapped Git repo |
SqlLens: Test mssql Extension Integration |
Diagnostic: mssql integration status |
SqlLens: Check Key Vault Credentials |
Diagnostic: Key Vault access |
No default bindings assigned. Add via File → Preferences → Keyboard Shortcuts → search SqlLens:
{ "key": "ctrl+shift+d", "command": "sqllens.analyzeDependencies" },
{ "key": "ctrl+shift+s", "command": "sqllens.searchDatabases" }
Cannot connect to SQL Server
localhost, .\SQLEXPRESS, or SERVER\INSTANCESqlLens: Update Server Password if credentials changed"Not logged in" errors
SqlLens: Login to unlock cloud featuresmssql Object Explorer right-click menu not showing
Compare with Git returns no results
SqlLens: Configure GitHub PAT) with repo scopeSqlLens: Manage GitHub Mappings)| Resource | Link |
|---|---|
| 🖥️ Desktop Application | Download |
| 📊 Desktop vs VS Code Feature Comparison | Feature_Comparison.md |
| 🔍 Full Desktop Reference Guide | https://sqllens.blob.core.windows.net/downloads/docs/guides/SqlLens_Reference.html |
| 🐛 Report Issues | GitHub Issues |
Part of the SqlLens SQL Server Analysis & Visualization toolset by Thoughts In Motion