SQL Sage · your own AI account in SSMS

Claude in SSMS — or ChatGPT/Codex — on your own AI account

Updated

SQL Sage puts Claude in SSMS: it is an extension for SQL Server Management Studio 22 that drives the AI access you already have — Claude through Claude Code, or a ChatGPT account through the Codex CLI — from a panel next to your query editor. You sign in inside those tools, so there is no separate key to create and none for us to hold. AI usage is not included: Claude Code needs a Claude plan that includes it or an Anthropic Console account, and Codex a ChatGPT account; the other option is your own Anthropic API key. This page is the mechanics: how the sign-in really works, what leaves your machine, where the two providers genuinely differ, and what the safety gate does before any SQL runs.

An answer in the SQL Sage chat panel in SSMS 22 with two classified SQL blocks: a CREATE INDEX with a red DDL badge and a DELETE with an amber WRITE badge, each showing the full SQL above Copy, Insert, New query and Run buttons.
Every SQL block the AI writes carries its class. Run on a WRITE or DDL block opens a confirmation with the full SQL first.

AI usage not included: Claude Code or the Codex CLI runs on your own plan. See pricing

Download (30-day trial, then Free)

Captures from SSMS 22 on the AdventureWorks2022 sample database, 38 seconds, no sound: related tables after JOIN, SQL Sage Search, Explain error, What's blocking now and “Is this slower than before?”. Server, login and computer names are pixelated.

On this page

  1. What it is
  2. Five ways to get Claude in SSMS
  3. Coming from Claude Code + MCP?
  4. How CLI sign-in works
  5. CLI sign-in vs BYOK vs Copilot BYOM
  6. Claude or ChatGPT/Codex — what differs
  7. What it does with your SQL
  8. The safety gate
  9. What leaves your machine
  10. Proof and accountability
  11. New models, no new release
  12. FAQ
  13. Requirements and first run

01An add-in inside SSMS, not a website

SQL Sage installs into SQL Server Management Studio 22 on Windows and runs as part of the SSMS process on your own machine. It is not a web app, not an online SQL editor, and nothing about your database is proxied through our servers. The assistant lives in a dockable panel beside the query editor, and a connection bar at the top of that panel shows the server, database and login the current chat is using — at all times, not on hover. By default the chat follows whichever query window is active; when you are working across several servers you can pin it to one window so it keeps that connection while you move around. Either way an answer is grounded in a known engine edition, version and database rather than in SQL Server in general.

The same panel talks to either provider. Picking Claude or OpenAI is a pair of tabs in the status bar, with the model dropdown beside them — not a different product, a different install, or a different licence — and your conversation history survives switching provider or model mid-session.

02Five ways to get Claude in SSMS (October 2026)

SQL Sage is one of five routes, and not always the right one. Each row below cites the public source it rests on and the date we read it; check the source before you decide, because all five change quickly.

WayWhat it takesFits whenSource
1. Claude models in GitHub Copilot in SSMS A GitHub account with Copilot access. In SSMS 22, Copilot's model picker includes Claude Sonnet, Opus and Haiku models; which ones you get depends on your Copilot subscription, and on Copilot Business and Enterprise an administrator must enable the Preview policy first. GitHub lists Copilot Free with “Auto model selection only” and 50 chat requests and 2,000 completions a month, and Copilot Pro ($10 USD per month) with “A selection of models”; every Copilot plan includes its AI usage. Copilot's Agent mode, generally available since SSMS 22.10.2 (2026-09-28), can run queries, and by default asks for your approval before each one. You already have Copilot (Copilot Free included), or your organisation standardises on Microsoft's first-party assistant. Microsoft Learn, AI models (updated 2026-10-14); Agent mode (2026-09-28); SSMS release notes (22.10.2); GitHub Docs, Copilot plans and GitHub Copilot plans; all read 2026-10-20
2. Copilot “bring your own model” with an Anthropic key Copilot in SSMS plus your own Anthropic API key, added under Manage Models, so you control and monitor that API usage directly with Anthropic. It covers Copilot Chat only, and it is not available for Copilot Business or Enterprise users. You use Copilot on an individual plan and want to choose and pay for the Claude model directly. Microsoft Learn, AI models (Bring your own model) (updated 2026-10-14, read 2026-10-20)
3. Claude models in Devart's dbForge AI Assistant dbForge SQL Complete in SSMS with its AI Assistant, which includes the AI usage: the Express tier is $0 with 200,000 tokens a month, and Professional is $9.95 a month or $99.95 a year, as a subscription only. Devart lists Claude Haiku 4.5, Sonnet 4.6 and Sonnet 5 among its models, next to OpenAI's. Which models the free Express tier offers: — (not stated on that page). You already work in dbForge SQL Complete and want AI usage included in the price rather than on your own plan. Devart, dbForge AI Assistant (read 2026-10-20)
4. An SSMS add-in that drives the Claude Code CLI Claude Code installed and signed in on your machine, plus an add-in. SQL Sage (this page) also drives the Codex CLI for ChatGPT, or takes your own Anthropic API key. SsmsAgentic uses the Claude CLI installed on your machine, targets SSMS 22 with SSMS 21 on a best-effort basis, and sells one-time licences from $49 after a 15-day trial. You want Claude in a panel beside the query window, on the Claude plan you already pay for, without a Copilot licence. This page; ssmsagentic.io (read 2026-10-20); details side by side in AI for SSMS, compared
5. Claude Code in a terminal, with sqlcmd or an MCP server Claude Code on its own, connected to SQL Server through sqlcmd or an MCP server configured with a server, login and password. It works outside SSMS, in a terminal or the desktop app, not beside your query editor. Long agent sessions across scripts and a repository, where you do not need the open SSMS connection. Brent Ozar, “Using Claude Code with SQL Server and Azure SQL DB” (2026-03-12, read 2026-10-17)

SQL Sage is independent: it is not affiliated with Anthropic, Microsoft, GitHub or the makers of the other tools named here. If you want the assistant to work through a multi-step task on the server, agents in SSMS covers how that works and where it stops.

03Coming from Claude Code + MCP?

If you already run Claude Code in a terminal against SQL Server, you already have what SQL Sage needs: the same Claude Code sign-in. There is nothing to migrate and nothing to give up, because the two do different jobs.

04How CLI sign-in actually works

Most AI add-ins ask you for an API key. On this path SQL Sage asks for no key, because it does not talk to Anthropic or OpenAI itself. It talks to the command-line tool already installed and signed in on your machine — claude (Claude Code) for the Claude channel, codex for the ChatGPT/Codex channel — and lets that tool carry the authentication it already holds.

Concretely, on the Claude channel SQL Sage launches the CLI in non-interactive mode with a streaming JSON transcript (claude -p --output-format stream-json --verbose --include-partial-messages) and writes the prompt to the process's standard input rather than onto the command line — a schema-heavy prompt for a large production database would otherwise exceed the Windows command-line limit. Tokens are streamed back as they arrive, which is why the answer appears word by word instead of after a pause.

Zero token custody, by construction. On the CLI channels there is no code path in SQL Sage that reads, copies, stores, or transmits your provider credentials — it cannot leak a token it never receives. (The one exception is the optional BYOK key you type in yourself, covered in the next section.) Your session lives where you created it, in the CLI's own storage; we never touch those files. The panel's only question is the one the CLI can answer for itself — claude auth status on one channel, codex login status on the other — and it displays the reply, including which account and plan you are signed in as.

The practical consequences are worth spelling out. Rotating or revoking access is done in your Claude or ChatGPT account and takes effect immediately, with nothing to clean up in SSMS. If your CLI session expires, SQL Sage does not silently fall back to some other credential — the channel simply reports itself unavailable until you sign in again. And because the inference runs on your own subscription, usage is billed by your provider under the terms you already accepted: SQL Sage is not an intermediary for AI inference, does not meter it, and does not resell access to models.

05CLI sign-in vs BYOK vs Copilot BYOM vs an API-key add-in

Four arrangements are easy to confuse, so here is what each one actually means for you.

ArrangementWhat you supplyWho holds the secretWho is billed
CLI sign-in (default)A Claude or ChatGPT account, signed in inside the local CLIThe CLI on your machine — SQL Sage never receives itYour own Claude or ChatGPT plan, under its usage limits
BYOK (advanced)Your own Anthropic API keyOne opaque blob on your machine, encrypted with Windows DPAPI scoped to your user account (%LOCALAPPDATA%\SqlSage\byok.dat) — never in plaintext, the registry, or version controlYour Anthropic API account, per token
Copilot BYOM (Anthropic key)A GitHub account with Copilot access, plus your own Anthropic API key added under Manage Models in Copilot Chat; not available for Copilot Business or Enterprise usersGitHub Copilot in SSMS — where it keeps the key is not stated in Microsoft's documentationYour Anthropic API account, per token (Microsoft Learn, AI models, updated 2026-10-14, read 2026-10-20)
A typical API-key add-inAn API key pasted into the toolThe tool, wherever it chooses to keep itUsually your API account; sometimes the vendor resells inference

BYOK exists as an escape hatch for people who cannot or will not install a CLI — for instance on a locked-down workstation. Note the asymmetry honestly: BYOK is implemented for Anthropic only. There is no OpenAI API-key path, so reaching ChatGPT or Codex means going through the Codex CLI. If your organisation forbids both a CLI and an outbound API key, no configuration of SQL Sage will help, and it is better to know that before you install.

06Claude or ChatGPT/Codex — what actually differs

For everyday T-SQL work — explaining an error, reading an execution plan, rewriting a query — both channels get the same tools, the same schema context and the same safety gate, because all of that lives in SQL Sage rather than in the model. What differs is a small number of concrete engineering facts, not marketing positioning:

Everything else is symmetric: both channels call the same tools, obey the same safety gate, write to the same audit log, and keep your conversation when you switch between them mid-session.

07What it does with your SQL

The assistant reasons about the server in front of you, because it can measure it. It has 26 authored tools — deterministic queries we wrote and reviewed, not SQL the model improvises — covering the catalogue, Query Store, the plan cache, wait and index statistics, live requests, deadlock history, permissions and backups. The model chooses which one to call and interprets what comes back; it does not invent the numbers.

Every SQL block the assistant writes carries a classification badge — READ, WRITE, DDL, or SQL? for a statement that cannot be proven safe — and a one-click toolbar: Copy · Insert · New query · Run · Format · Prove ≡. Press Run on anything that is not a plain read and the confirmation dialog names the class again in its own words: WRITE, DDL, or UNSAFE for the unprovable case. Insert is deliberately not Run: putting text in your editor and executing it against a database are two different buttons.

08The safety gate: classify first, then decide

Nothing an AI writes reaches your server on trust. Before execution, every batch is split on GO the way SSMS splits it and parsed into an abstract syntax tree by ScriptDom — Microsoft's own T-SQL parser, the TSql180Parser — then classified as Read, Write, DDL or Unknown. A batch takes the worst class any statement in it earns. The classification is deterministic and escalates on exactly the cases that catch people out:

There is one more gate on your side of the keyboard: when you press F5 on something genuinely destructive — a DELETE or UPDATE with no WHERE, a DROP, a TRUNCATE and, from version 0.32.0, a KILL — SQL Sage asks first, using the same parser.

The parser is the chokepoint, and that matters more than any instruction in a prompt could: a model cannot talk its way past a gate that is not made of words.

09What leaves your machine — and what does not

The assistant needs enough context to be useful, which is your query text and the shape of your schema. It does not need your data, so by default it never sees it.

Because inference runs on your own account, your direct relationship with Anthropic or OpenAI governs how that context is handled; we are not a sub-processor for it. The Privacy Policy spells this out field by field, and the sub-processor list names everyone we do use.

10Proof and accountability, not just answers

Confidence is cheap and a plausible answer about production is dangerous. The parts of SQL Sage that exist to prove things do not take the model's word: the checks get their numbers from SQL we wrote and reviewed, run on your server. The “Same rows?” check and the audit log use no AI tokens; blast radius and on-call triage run inside an AI answer today (the model calls the tool), so they use your AI account like any other answer:

11New models appear without a new release

Model line-ups change faster than any extension ships, so the picker is filled from your own installation rather than from a list we ship: the Claude channel asks your local Claude Code which models it offers (a handshake with no message sent and no model called), and the Codex channel reads the model catalogue Codex itself keeps on your machine. When a new Claude or ChatGPT/Codex model reaches your CLI, it shows up in the picker without a SQL Sage release. Next to that, SQL Sage fetches a small signed policy from the same host as its update manifest — cached for 30 minutes, size-capped, abandoned after a three-second timeout, and ignored unless its signature checks out — which can hide a model, mark the recommended default or name the minimum CLI version a model needs. If your CLI cannot be asked, the panel falls back to the last list it read, then to the list built into your version: being offline costs you choice, not the product. One caveat stated plainly: the list is only as new as your CLI, so update Claude Code or Codex to see a model it does not know yet.

One hardening detail, since it is the kind of thing that gets skipped: a model identifier is eventually passed as an argument to a CLI that may be launched through a .cmd shim, where argument quoting does not neutralise shell metacharacters. Every identifier is therefore validated against a strict format rule before it can reach the command line — alphanumerics, dots, underscores and hyphens only, 64 characters at most, no whitespace and no shell metacharacter — and a malformed string is replaced with a known-good alias rather than passed on. Be precise about what that buys: a well-formed name for a model that does not exist still reaches the CLI, which rejects it. What cannot get through is an injected command.

12FAQ

Do I need an API key for SQL Sage?

Not a separate one. With a Claude Code or Codex CLI sign-in, SQL Sage uses that sign-in and asks for no key of its own. Your AI plan still applies and AI usage is not included: Claude Code needs a Claude plan that includes it, such as Pro or Max, or an Anthropic Console account, and the Codex CLI a ChatGPT account. If you cannot install a CLI, you can paste your own Anthropic API key (BYOK) instead.

Does it work with a ChatGPT account?

Yes, through the Codex CLI signed in with your ChatGPT account. The same panel, tools and safety gate serve both providers, and you switch between them in the status bar. BYOK is Anthropic-only, so ChatGPT and Codex always go through the Codex CLI.

Can I use Claude models through GitHub Copilot in SSMS instead?

Yes. According to Microsoft Learn (AI models, updated 14 October 2026), the model picker of GitHub Copilot in SSMS 22 includes Claude Sonnet, Opus and Haiku models, depending on your Copilot subscription, and outside Copilot Business and Enterprise you can add your own Anthropic API key. That route needs a GitHub account with Copilot access; SQL Sage needs none and runs on your own Claude or ChatGPT plan.

Is it safe to use against a production server?

It is read-only by default. Every batch is parsed by ScriptDom before it runs: a genuine SELECT on the system catalogs and DMVs is run read-only with a row cap and a timeout, and one on your own tables only after you agree to share results for the session (until then the AI sees only its column names and types), while writes, schema changes and anything the parser cannot prove to be a read stop at a dialog that shows the full SQL. Result rows are sent to the AI only if you switch Include results on and consent for that server, database and provider.

13Requirements and first run

  1. Install SQL Sage and reopen SSMS — the panel appears, or open it from View → Other Windows → SQL Sage.
  2. In the status bar pick your provider. Sign in with Claude finishes in the console window that opens; then click Refresh. Sign in with OpenAI goes through the Codex CLI.
  3. Choose a model, then select some T-SQL and press Ctrl+Alt+Shift+E.

Every install starts a 30-day free trial with all features, no credit card and no account, and licence checks fail safe — there is a 14-day offline grace period, so a flaky network or a week on a plane will not lock you out. The step-by-step walkthrough lives in the documentation; if you are weighing this against GitHub Copilot in SSMS or other add-ins, the side-by-side comparison is the honest version, with sources. For multi-step work on the server, see agents in SSMS.

AI usage not included: SQL Sage needs your own AI access (Claude Code on a paid Claude plan, a ChatGPT plan that includes the Codex CLI, or your own Anthropic API key). See pricing

Download (30-day trial, then Free)