SQL Server Agent for VS Code
Manage SQL Server Agent (Jobs, Alerts, Operators, Schedules, Proxies, Maintenance Plans) directly from VS Code with an SSMS-like Object Explorer experience.
This extension delegates every database connection to the official Microsoft SQL Server (mssql) extension through its public Connection Sharing API: it never asks you for credentials, never opens a TDS socket on its own, and never persists secrets — it just reuses the connection profiles you already configured in ms-mssql.mssql.
Supported: SQL Server 2008 R2 → 2022 (anything where SQL Server Agent ships). Version-sensitive T-SQL is feature-gated at runtime via SERVERPROPERTY('ProductMajorVersion'). Azure SQL Database is not supported (no Agent); Managed Instance and IaaS SQL Server are.
Trademark notice: this is an independent extension and is not affiliated with or endorsed by Microsoft. Microsoft, SQL Server, and SQL Server Agent are trademarks of the Microsoft group of companies.
Why this extension
With Azure Data Studio (and its SQL Agent extension) retired in February 2026 and the official ms-mssql.mssql extension not covering the Agent, VS Code users were left without a way to manage SQL Server Agent — especially on macOS and Linux, where SSMS does not run.
This extension is a dedicated Agent specialist, not a general admin toolbox. Beyond listing jobs, operators and proxies, it gives you the parts of the Agent that are otherwise hard to reach outside SSMS:
- Alerts — full CRUD, including a cascading performance-counter picker (
sys.dm_os_performance_counters), per-operator notification methods, and alert history.
- Shared schedules — first-class CRUD with an SSMS-style editor and live plain-English recurrence summaries, attach/detach from the job editor.
- Live activity — an opt-in poller that decorates currently-running jobs (with the executing step) directly in the tree, plus a job activity timeline chart.
- Job history you can actually work with — filters (date range, outcome, step) and CSV / JSON / XLS export.
- Search across job steps — full-text search over every step name and command on the server.
- Maintenance Plans — run subplans, edit subplan schedules, inspect the task tree.
It happily coexists with any other SQL Server tooling: connections are borrowed from ms-mssql.mssql, so there is nothing new to configure and no credentials to duplicate.
What's new in 0.7.0
- Job Activity Timeline overhaul — readable adaptive time axis, the chart focuses exactly the selected From/To window, and a Reset range button expands to the full recorded history.
- Fixes: Agent properties no longer risk overwriting the Agent error-log path; purge-history by date works; step output (Log to table) loads; export dialogs default to the workspace folder.
What's new in 0.6.0
- Job activity timeline — per-job execution bars with date-range filter and CSV/PNG export.
- See
CHANGELOG.md for the complete list.
What's new in 0.5.0
- Native webview controls — the deprecated
@vscode/webview-ui-toolkit is gone; every button, field, dropdown, checkbox, and tab is now native HTML styled with VS Code theme variables. Create/Close buttons and dropdowns work reliably everywhere.
- SSMS-style schedule editor — layout adapts to the schedule type (Recurring / One time / Agent start / CPU idle) with weekly/monthly sub-layouts, plus a live English summary ("Occurs every week on Monday and Friday at 10:30:00 PM…") used in the editor, in the job Schedules tab, and as tree tooltips.
- Job steps — database dropdown from
sys.databases, owner login dropdown from sys.server_principals, and syntax-highlighted Command editor (T-SQL / PowerShell / CmdExec).
- Maintenance Plans operational — Run Subplan Now, Edit Subplan Schedule, open the subplan agent job, and View Plan Tasks (read-only DTSX task tree parsed from
msdb.dbo.sysssispackages). Editing the SSIS task flow itself still requires SSMS.
- See
CHANGELOG.md for the complete list.
What's new in 0.4.0
- Full Agent node parity (view + edit): category rename, alert history, SQL Server Agent properties, Job Activity stop/history/refresh, enriched tree (job Alerts/Notifications folders), and cross-object hyperlinks across editors.
- Job editor shortcuts: create a new shared schedule or a new alert pre-filled for the current job from the Schedules / Alerts tabs.
- Exports: Job History and Alert History support XLS in addition to CSV/JSON.
- See
CHANGELOG.md for the complete list.
What's new in 0.2.0
- SQL 2008 R2 compatibility —
xp_readerrorlog and sp_add_schedule no longer crash on older servers.
- Live activity monitor — opt-in poller (
sqlAgent.activity.pollIntervalMs) that decorates currently-running jobs in the tree.
- History under the job node — last N runs are listed inline (configurable via
sqlAgent.tree.historyChildrenCount).
- Cancellable progress — long-running operations (history load, step search) surface a Cancel button.
- Search across job steps —
SQL Agent: Search across Job steps… opens a QuickPick of every step whose name or command matches a substring; selecting a result jumps to the Steps tab of the job editor.
- Export Job History — CSV / JSON buttons on the History view.
- Schedule wizards — dedicated panels for
freq_type=1 (Once) and freq_type=32 (Nth weekday) instead of raw numeric inputs.
- Step Advanced fields — logging-flag bitmask checkboxes and
databaseUserName per step.
- Performance-counter picker for Alerts — cascading Object → Counter → Instance dropdowns sourced from
sys.dm_os_performance_counters, plus comparator and threshold.
- Better error mapping —
KNOWN_ERRORS now covers 14279/14513/14525/14550/15247/2812/50000 and parses nested Msg N references.
- Opt-in query log —
sqlAgent.diagnostics.logQueries echoes every query (truncated) and its duration in the SQL Agent output channel.
See the full breakdown in CHANGELOG.md.
Features
Read
- TreeView (Activity Bar → SQL Agent) per active mssql connection
- Jobs (status icon based on last run outcome) → Steps, Schedules, Alerts, Notifications, History (last N)
- Alerts (severity / message_id / performance / WMI) with notifications
- Operators (email / pager / netsend / on-duty schedule)
- Schedules (shared)
- Proxies (with subsystem grants and principals allowed)
- Maintenance Plans → Subplans (run now, edit schedule, open agent job), History, read-only DTSX task tree
- Job Activity (running / idle snapshot + timeline chart)
- Error Logs (paginated)
- SQL Agent service state detection via
xp_servicecontrol, with a banner in the tree when the Agent service is stopped or unavailable.
Write
- Full CRUD on Jobs (multi-tab editor: General / Steps / Schedules / Alerts / Notifications / Targets, drag-reorder of steps, transactional save based on diff against
sp_help_job @job_aspect = 'ALL').
- Full CRUD on Operators, Alerts, Schedules, Proxies via dedicated webview editors built with React 18 and native VS Code-themed controls.
- Inline actions: Start / Stop / Enable / Disable / Delete with confirmations.
- Job History webview with filters (date range, outcome, step).
- Script as CREATE for every editable entity (uses
connectionSharing.scriptObject where available, fallback to T-SQL templates generated in the extension).
Prerequisites
- VS Code
>= 1.85.0.
- SQL Server (mssql) — installed automatically as an extension dependency.
- At least one MSSQL connection profile pointing to a server that hosts the SQL Server Agent (it lives in the
msdb database, on the SQL Server Database Engine — not Azure SQL DB).
- The login used for the connection must be member of one of
SQLAgentUserRole, SQLAgentReaderRole, SQLAgentOperatorRole (in msdb) or sysadmin. Write operations additionally require SQLAgentOperatorRole or sysadmin.
The first time the SQL Agent extension calls any method on the mssql Connection Sharing API, the mssql extension will prompt you for permission. Approve it once and you are good to go.
Quick start
- Install the extension (or press
F5 from this repo to launch a development host — see Development below).
- Open the SQL Server (mssql) extension and connect to a server.
- Switch to the SQL Agent activity in the activity bar.
- Press Connect… (icon
$(plug)) in the view toolbar. Pick one of your saved mssql connection profiles. The tree will populate with the Agent folders.
Commands
All commands are also published in the Command Palette under the prefix SQL Agent:.
| Command |
Title |
sqlAgent.connect |
Connect… |
sqlAgent.refresh |
Refresh (full tree, or just the right-clicked branch) |
sqlAgent.disconnect |
Disconnect |
sqlAgent.job.new |
New Job… |
sqlAgent.job.edit |
Edit… (Job) |
sqlAgent.job.start |
Start Job |
sqlAgent.job.stop |
Stop Job |
sqlAgent.job.enable / sqlAgent.job.disable |
Enable / Disable |
sqlAgent.job.delete |
Delete |
sqlAgent.job.history |
View History |
sqlAgent.job.scriptCreate |
Script as CREATE |
sqlAgent.operator.*, sqlAgent.alert.*, sqlAgent.schedule.*, sqlAgent.proxy.* |
New / Edit / Delete / Script as CREATE |
sqlAgent.search.jobSteps |
Search across Job steps… |
sqlAgent.activity.toggle |
Toggle Live Activity Monitor |
Settings
| Setting |
Default |
Description |
sqlAgent.history.maxRows |
200 |
Max rows fetched from sp_help_jobhistory. |
sqlAgent.tree.historyChildrenCount |
10 |
Number of history entries shown under each Job in the tree. |
sqlAgent.queryTimeoutMs |
60000 |
Timeout (ms) for msdb queries (re-read on every call so it can be changed live). Note: executeSimpleQuery does not actually support cancellation — the timeout is only enforced on the wrapper side. |
sqlAgent.diagnostics.logQueries |
false |
When true, every executed query is echoed (truncated to 2 KB) and its duration is logged to the SQL Agent output channel. |
sqlAgent.activity.pollIntervalMs |
0 |
When > 0, poll msdb.dbo.sysjobactivity every N ms (suggested 5000 / 15000) to decorate running jobs. Set to 0 to disable. Polling is automatically paused while the view is hidden. |
sqlAgent.connect.auto |
true |
Reuse the active MSSQL editor connection when connecting. |
Architecture
TreeView ─┐
├─► commands ─► services (jobsService, …)
Webviews ─┘ │
▼
queryRunner ─► ms-mssql.mssql ─► msdb
src/mssql/ — thin wrapper around vscode.extensions.getExtension('ms-mssql.mssql').exports.connectionSharing. Exposes exec<T>(uri, sql) that marshals SimpleExecuteResult rows into typed DTOs (case-insensitive column mapping + numeric/date/bool parsing).
src/services/ — one file per area (jobsService, extendedEventsService, xeEventReader, …).
src/webviews/ — React editors including extendedEventsViewer and xeSessionDesigner.
Development
npm install
npm run compile # one-shot build (extension + webviews)
npm run watch # incremental rebuild
npm run typecheck # tsc --noEmit
npx @vscode/vsce package # produces sqlserver-agent-<ver>.vsix
Then in VS Code press F5 to launch the Extension Development Host.
Publishing
- Create a Visual Studio Marketplace publisher (must match
publisher in package.json).
- Add a 128×128 PNG icon as
resources/icons/sqlagent.png and set "icon" in package.json (optional for local .vsix, required for Marketplace).
npx @vscode/vsce login <publisher>
npm run package && npx @vscode/vsce publish
CI (.github/workflows/ci.yml) runs compile, typecheck, tests, and VSIX packaging on every push/PR.
The included .vscode/launch.json configures the debug session for you.
Limitations
- The extension does not open its own TDS socket; every query goes through
connectionSharing.executeSimpleQuery, which does not support cancellation. Long-running operations will run to completion server-side even if the UI gives up.
- Maintenance Plans are exposed in read-only mode (creation/edit of SSIS packages is well beyond the scope of an msdb-only extension).
- Multi-server (MSX/TSX) targets are surfaced on the Job editor but cannot be configured.
- Azure SQL Database is not supported (no Agent). Managed Instance and IaaS SQL Server are.
License
MIT — see LICENSE.
| |