Linked Server Explorer
A VS Code extension that browses tables, views, and columns exposed
through SQL Server linked servers — the thing SSMS's linked-server
"Catalog" view does (but very poorly), that the official MSSQL extension doesn't.
This supports SQL, Oracle and Snowflake linked servers.
It manages its own connections (separate from the MSSQL extension) using
the mssql (tedious) driver.
What it does
- Adds a "Linked Servers" panel in the Activity Bar.
- Connection → Linked Server → Schema → Tables/Views → Columns, expanded lazily and cached in memory per linked server.
- Filter icon in the panel title: contains-match on table/view name, filters cached data only (no refetch).
- Refresh icon in the panel title (whole tree) and inline on each schema node (just that schema).
- Drag a table or column node into an open editor to paste
schema.name.
- Right-click a table for:
- Copy Four-Part Name —
[LinkedServer].[Catalog].[Schema].[Table]
- Script SELECT (Four-Part Name)
- Script SELECT (OPENQUERY)
- Right-click a view for everything above, plus Script as Create — pulls
the remote
CREATE VIEW definition into a new editor tab.
Pairs well with the MSSQL extension
This extension only browses schema and generates SQL — it doesn't run
queries or render results. Install Microsoft's
MSSQL extension
alongside it and the scripted SELECT statements (both the four-part-name
and OPENQUERY variants) run through MSSQL's query runner with its full
results grid: column sorting/filtering, cell selection, and export to CSV/JSON/Excel.
Issues
If you have any issues, please create an issue at: https://github.com/DaleCam/Linked-Server-Explorer/issues
PRs very welcome!
How introspection works
For each level it tries a chain of strategies and uses the first one that
returns rows, in this order:
- Tables/views:
sp_tables_ex → ANSI INFORMATION_SCHEMA.TABLES via
OPENQUERY → Oracle ALL_TABLES/ALL_VIEWS via OPENQUERY.
- Columns: Snowflake
SHOW COLUMNS IN TABLE via pass-through
(EXEC ('...') AT [linkedServer]) → sp_columns_ex → catalog-qualified
then unqualified INFORMATION_SCHEMA.COLUMNS via OPENQUERY → Oracle
ALL_TAB_COLUMNS via OPENQUERY.
sp_tables_ex/sp_columns_ex work well for SQL-Server-to-SQL-Server
links and well-behaved OLE DB/ODBC providers. The OPENQUERY fallbacks
cover most other RDBMSes (Postgres, MySQL, Oracle) as long as the linked
server allows arbitrary pass-through queries. A tooltip on each node shows
which strategy produced it.
Note: OPENQUERY requires the linked server to have RPC OUT /
ad hoc query support enabled, and read access to those catalog views on
the remote side. If a node shows "No tables/views found" or "No columns
found," hover it — the tooltip carries the underlying error from every
strategy that was tried.
Authentication
- SQL Login — most reliable cross-platform option.
- Windows / Integrated —
tedious has no true SSO (that needs the
native msnodesqlv8 driver). This auto-detects your domain/username
from the environment and authenticates via NTLM, but still needs your
Windows password once (stored in SecretStorage, never in plain settings).
- Azure AD Password.
Running it from source
npm install
npm run compile
Then press F5 in VS Code (with this folder open) to launch an
Extension Development Host with it loaded. Click the server icon in the
Activity Bar, then the + button to add a connection.
Packaging / publishing
npm install -g @vscode/vsce
vsce package # produces a .vsix for local install
vsce publish # publishes to the Marketplace (requires a PAT)
Known limitations
- No live invalidation — remote schema changes need a manual refresh
(whole-tree or per-schema icon).
OPENQUERY/pass-through fallbacks assume standard ANSI/Oracle/Snowflake
catalog access; a provider with a nonstandard catalog may still come back
empty. Easy to add another strategy in sqlIntrospection.ts if you hit one.
Credits
Extension icon adapted from Carbon Pictograms (IBM, Apache-2.0).