<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mostafa Tabatabaei</title>
    <description>The latest articles on DEV Community by Mostafa Tabatabaei (@mosyi_99c4f2).</description>
    <link>https://dev.to/mosyi_99c4f2</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1752645%2Fc552c407-5a0c-4b72-ae5a-0f33ac7f84d8.png</url>
      <title>DEV Community: Mostafa Tabatabaei</title>
      <link>https://dev.to/mosyi_99c4f2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mosyi_99c4f2"/>
    <language>en</language>
    <item>
      <title>GitHub Copilot in SSMS 22 vs. a Local 7B Model Extension: An Honest Comparison</title>
      <dc:creator>Mostafa Tabatabaei</dc:creator>
      <pubDate>Thu, 05 Nov 2026 05:18:45 +0000</pubDate>
      <link>https://dev.to/mosyi_99c4f2/github-copilot-in-ssms-22-vs-a-local-7b-model-extension-an-honest-comparison-3lie</link>
      <guid>https://dev.to/mosyi_99c4f2/github-copilot-in-ssms-22-vs-a-local-7b-model-extension-an-honest-comparison-3lie</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; Copilot in SSMS 22 now has a "bring your own model" option — but the provider list is locked (OpenAI, Anthropic, Google, xAI, Azure, Foundry Local), it still needs a GitHub account, and background services keep calling the Copilot API. A local extension connects to &lt;em&gt;any&lt;/em&gt; OpenAI-compatible server (LM Studio, Ollama, vLLM), needs zero accounts, and works on SSMS 21 &lt;em&gt;and&lt;/em&gt; 22. Here's an honest side-by-side — including the things Copilot does better.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Full disclosure up front: &lt;strong&gt;I built the local extension&lt;/strong&gt; (&lt;a href="https://github.com/Fargo4u/ssms-ai-assistant" rel="noopener noreferrer"&gt;Arman AI Assistant&lt;/a&gt;), so weigh my judgment accordingly. The Copilot facts below come from &lt;a href="https://learn.microsoft.com/en-us/ssms/github-copilot/overview" rel="noopener noreferrer"&gt;Microsoft's own documentation&lt;/a&gt; — if anything here is out of date, tell me in the comments and I'll correct it with credit.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Copilot in SSMS 22 actually offers
&lt;/h2&gt;

&lt;p&gt;Credit where it's due: this is no longer a toy. Copilot in SSMS ships as the &lt;strong&gt;AI Assistance&lt;/strong&gt; workload in the Visual Studio Installer, and per Microsoft's docs you now get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Chat&lt;/strong&gt; (and inline chat) grounded on your database connection&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Slash commands&lt;/strong&gt; like &lt;code&gt;/doc&lt;/code&gt; to document, explain, fix, or optimize T-SQL&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Editor autocompletions&lt;/strong&gt; since SSMS 22.2&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent mode&lt;/strong&gt; since SSMS 22.7 — give it a high-level goal and it works autonomously: executes queries, reads execution plans, modifies schema (with your approval), and can be extended with agent skills and &lt;strong&gt;MCP servers&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's a serious product. There's also &lt;strong&gt;BYOM — "bring your own model"&lt;/strong&gt;: in the chat's model picker, choose &lt;strong&gt;Manage Models&lt;/strong&gt; and add a model with your own API key from OpenAI, Anthropic, Google, xAI, or Azure — plus &lt;strong&gt;Foundry Local&lt;/strong&gt;, Microsoft's local runtime and the one genuinely offline route.&lt;/p&gt;

&lt;p&gt;That's real progress. &lt;strong&gt;Foundry Local&lt;/strong&gt; deserves a proper mention: it runs ONNX models on your own hardware through Microsoft's runtime, so "local" is genuinely achievable — it just means picking from Microsoft's catalog rather than your own download folder. Now the fine print — because there's a gap between "bring your own model" and "bring your own server."&lt;/p&gt;

&lt;h2&gt;
  
  
  The fine print
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The provider list is fixed.&lt;/strong&gt; There's no generic OpenAI-compatible endpoint field. You can't point Copilot in SSMS at &lt;code&gt;http://localhost:1234/v1&lt;/code&gt;, so LM Studio, Ollama, vLLM and llama.cpp don't connect directly. Whatever coder model you already have downloaded is out of reach unless Foundry Local happens to ship it. That distinction sounds cosmetic until you actually run it: the whole point of LM Studio and Ollama is that the model, the weights and the traffic belong to nobody but you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A GitHub account is still required.&lt;/strong&gt; Even with your own API key, the experience stays anchored to Copilot sign-in. And BYOM is &lt;strong&gt;not available on Copilot Business/Enterprise plans&lt;/strong&gt; — corporate users are pinned to the default cloud models.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Background services still phone home.&lt;/strong&gt; The docs say it directly: &lt;em&gt;"Services like embeddings, intent detection, and repository indexing might continue to use the Copilot API"&lt;/em&gt; — even when you use a custom model. If your threat model is "no schema fragments leave this machine," that sentence deserves attention.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It's SSMS 22 only.&lt;/strong&gt; The earlier SSMS 21 preview used a different, Azure OpenAI-based experience that required provisioning an Azure OpenAI resource in the portal. If your shop is still on 21, none of this is waiting for you there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Availability.&lt;/strong&gt; GitHub Copilot isn't offered in sanctioned regions at all, and plenty of teams sit behind corporate blocks. Even the free tier starts with a GitHub account that can reach the service.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What the local route does differently
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/Fargo4u/ssms-ai-assistant" rel="noopener noreferrer"&gt;Arman AI Assistant&lt;/a&gt; is an open-source (MIT, no telemetry) VSIX that turns SSMS into a plain client for any OpenAI-compatible server. It doesn't try to be Copilot — it's a schema-aware chat panel plus a set of database workflows. It also deliberately skips things: no ghost-text autocompletions, no autonomous agent mode. A scoped toolset keeps even a small 7B model useful instead of ambitious. Where it differs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Any endpoint, any model.&lt;/strong&gt; Point it at LM Studio (&lt;code&gt;http://localhost:1234/v1&lt;/code&gt;), Ollama, vLLM, llama.cpp — or at OpenAI itself if you ever want to. Switchable in Options.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explicit schema injection.&lt;/strong&gt; Tables, columns, PK/FKs, indexes, views, procs, functions, triggers and row counts are injected into every prompt and cached — so even a small 7B model answers with your real object names instead of hallucinated ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structural guardrails.&lt;/strong&gt; Generated T-SQL passes a &lt;code&gt;PARSEONLY&lt;/code&gt; pre-check before execution, runtime errors trigger an auto-fix loop, and DDL is idempotent-only. The model can propose; it can't casually wreck your schema.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance workflow.&lt;/strong&gt; Explain Plan opens a graphical &lt;code&gt;.sqlplan&lt;/code&gt; viewer; &lt;strong&gt;Tune Query&lt;/strong&gt; pulls real DMV evidence — missing indexes, dead indexes, usage stats — instead of generic advice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analyze Database.&lt;/strong&gt; A one-click report generated from your actual schema, not a template.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero accounts, zero keys, zero billing&lt;/strong&gt; — and it runs on &lt;strong&gt;SSMS 21 and 22&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Side by side
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Copilot in SSMS 22&lt;/th&gt;
&lt;th&gt;Local extension (Arman)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Install&lt;/td&gt;
&lt;td&gt;VS Installer workload&lt;/td&gt;
&lt;td&gt;VSIX from Releases&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Account&lt;/td&gt;
&lt;td&gt;GitHub + Copilot access&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Model freedom&lt;/td&gt;
&lt;td&gt;Fixed list + Foundry Local&lt;/td&gt;
&lt;td&gt;Any OpenAI-compatible server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LM Studio / Ollama / vLLM&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fully offline&lt;/td&gt;
&lt;td&gt;Only via Foundry Local&lt;/td&gt;
&lt;td&gt;Always&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent mode (autonomous, MCP)&lt;/td&gt;
&lt;td&gt;✓ — 22.7+&lt;/td&gt;
&lt;td&gt;✗ — focused toolset&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inline autocompletions&lt;/td&gt;
&lt;td&gt;✓ — 22.2+&lt;/td&gt;
&lt;td&gt;✗ — chat + tools&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Works on SSMS 21&lt;/td&gt;
&lt;td&gt;✗&lt;/td&gt;
&lt;td&gt;✓&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Executed-SQL guardrails&lt;/td&gt;
&lt;td&gt;Approval-based&lt;/td&gt;
&lt;td&gt;PARSEONLY + auto-fix + idempotent DDL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DMV evidence&lt;/td&gt;
&lt;td&gt;You can prompt for it&lt;/td&gt;
&lt;td&gt;One-click Tune Query flow&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Background API calls&lt;/td&gt;
&lt;td&gt;Even with BYOM (per docs)&lt;/td&gt;
&lt;td&gt;Nothing leaves the machine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;Free tier (limited) / paid plans&lt;/td&gt;
&lt;td&gt;$0, MIT&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Read that table as "different priorities," not "winner." Copilot wins the top half; the local route wins the bottom half.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Copilot in SSMS is the right choice
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You already pay for Copilot and want a vendor-supported, zero-setup experience&lt;/li&gt;
&lt;li&gt;You want inline autocompletions and agent mode — the local extension has neither&lt;/li&gt;
&lt;li&gt;Your company prefers a Microsoft-managed product with familiar billing and admin controls&lt;/li&gt;
&lt;li&gt;Foundry Local covers your local-model needs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If that's you, honestly — use it. It's good, and it's improving monthly.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the local route wins
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Your data is regulated or air-gapped and the rule is &lt;em&gt;nothing&lt;/em&gt; leaves the machine — including embeddings&lt;/li&gt;
&lt;li&gt;You're on &lt;strong&gt;SSMS 21&lt;/strong&gt; and not migrating this quarter&lt;/li&gt;
&lt;li&gt;You're in a region where Copilot simply isn't offered, or you don't want another subscription tied to a payment method you don't have&lt;/li&gt;
&lt;li&gt;You already run LM Studio or Ollama and want SSMS to use &lt;em&gt;that&lt;/em&gt; model — not Microsoft's catalog&lt;/li&gt;
&lt;li&gt;You want structural guardrails and a DMV-based tuning workflow around the model, not just approvals&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it in 10 minutes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Grab the VSIX from &lt;a href="https://github.com/Fargo4u/ssms-ai-assistant/releases" rel="noopener noreferrer"&gt;GitHub Releases&lt;/a&gt; — CI-built, works on SSMS 21 &amp;amp; 22&lt;/li&gt;
&lt;li&gt;In LM Studio, load a model (a 7B coder is plenty) and start the server on port 1234&lt;/li&gt;
&lt;li&gt;Install the VSIX, open Options, set the endpoint to &lt;code&gt;http://localhost:1234/v1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Open the chat, ask in plain English, review the generated T-SQL, execute with guardrails&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/Fargo4u/ssms-ai-assistant" rel="noopener noreferrer"&gt;github.com/Fargo4u/ssms-ai-assistant&lt;/a&gt; — and if you want the backstory, including the two nastiest bugs I hit while connecting a local model to SSMS, I wrote about it in &lt;a href="https://dev.to/mosyi_99c4f2/i-put-a-local-7b-model-inside-ssms-21-22-no-cloud-no-api-keys-ii"&gt;my earlier post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you try it and hit anything weird, open an issue — that's the fuel this project runs on. And if you disagree with this comparison, say so in the comments. I'd genuinely like to know where I'm wrong.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>github</category>
      <category>microsoft</category>
      <category>tools</category>
    </item>
    <item>
      <title>I Put a Local 7B Model Inside SSMS 21 &amp; 22 (No Cloud, No API Keys)</title>
      <dc:creator>Mostafa Tabatabaei</dc:creator>
      <pubDate>Wed, 04 Nov 2026 09:02:48 +0000</pubDate>
      <link>https://dev.to/mosyi_99c4f2/i-put-a-local-7b-model-inside-ssms-21-22-no-cloud-no-api-keys-ii</link>
      <guid>https://dev.to/mosyi_99c4f2/i-put-a-local-7b-model-inside-ssms-21-22-no-cloud-no-api-keys-ii</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;TL;DR: I built a free, open-source SSMS 21 &amp;amp; 22 extension that plugs a &lt;strong&gt;locally-hosted 7B model&lt;/strong&gt; (served by LM Studio) straight into SQL Server Management Studio. Your schemas, your queries and your data never leave your machine — and the monthly bill is exactly $0. Repo at the end. 👇&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The problem: I wanted AI in my IDE, not in someone's cloud
&lt;/h2&gt;

&lt;p&gt;AI assistants for SQL are genuinely useful. They write your JOINs, they explain execution plans, they review stored procedures. But every single one of them ships your context to a remote API: your table names, your column names, sometimes data samples — all landing in somebody else's logs.&lt;/p&gt;

&lt;p&gt;In a lot of real environments that's a hard &lt;strong&gt;no&lt;/strong&gt;: regulated data, strict corporate rules, air-gapped servers. And in some parts of the world, international payments for API subscriptions are a whole separate problem of their own.&lt;/p&gt;

&lt;p&gt;Meanwhile, a 7B model running on my own GPU is &lt;em&gt;already good&lt;/em&gt; at T-SQL. It doesn't need Azure. It doesn't need OpenAI. It doesn't need the internet at all.&lt;/p&gt;

&lt;p&gt;So I asked a simple question: &lt;strong&gt;why does my SQL assistant need the cloud in the first place?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The answer, after a few evenings of C#: it doesn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Piece&lt;/th&gt;
&lt;th&gt;What it is&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;SSMS 21 &amp;amp; 22&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The new Visual-Studio-based release — finally extensible the modern way&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;LM Studio&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Local inference server, exposes an &lt;strong&gt;OpenAI-compatible API&lt;/strong&gt; on &lt;code&gt;http://localhost:1234/v1&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;A 7B chat model&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Any model LM Studio can run — Qwen2.5-Coder-7B-Instruct is my pick for T-SQL work&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Arman AI Assistant&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The VSIX extension I wrote to glue it all together (MIT, open source)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;No cloud, no API key, no telemetry. Everything runs between SSMS, LM Studio and SQL Server on your machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the extension actually does
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv3cmvcnp7noisq7v4bra.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv3cmvcnp7noisq7v4bra.png" alt="Chat panel in SSMS 21 &amp;amp; 22 dark theme" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Chat panel inside SSMS&lt;/strong&gt; — a proper tool window, dark theme included, with the database switcher at the top&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full schema awareness&lt;/strong&gt; — the extension reads your real schema through SMO: tables, columns, PKs/FKs, indexes, views, stored procedures (with parameters), functions, triggers, even row counts — and injects it into every prompt, cached on disk&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analyze Database&lt;/strong&gt; — one click, and the model reports facts from &lt;em&gt;your&lt;/em&gt; database (real tables, real row counts), not generic advice:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fouen8v192o3vb00zt1vd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fouen8v192o3vb00zt1vd.png" alt="Analyze Database report" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Execute button under every SQL block&lt;/strong&gt; — with a safety net: every script is first syntax-checked with &lt;code&gt;SET PARSEONLY&lt;/code&gt; (nothing executes on a syntax error), and runtime failures are sent back to the model for an automatic fix before you even see them&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New Query button&lt;/strong&gt; — pushes the generated SQL into a real SSMS query window on SSMS' own connection, F5 to run&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explain Plan / Open Plan&lt;/strong&gt; — extracts the estimated plan (&lt;code&gt;SET SHOWPLAN_ALL&lt;/code&gt;, the query is never executed), and can even open the XML plan in SSMS' own &lt;em&gt;graphical&lt;/em&gt; plan viewer&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tune Query&lt;/strong&gt; — collects real evidence from the server: the XML plan, &lt;code&gt;sys.dm_db_missing_index_*&lt;/code&gt; suggestions, and &lt;code&gt;sys.dm_db_index_usage_stats&lt;/code&gt; for dead-index detection, then turns it into idempotent &lt;code&gt;CREATE INDEX&lt;/code&gt; scripts and safe drop candidates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And because small local models hallucinate &lt;em&gt;confidently&lt;/em&gt;, the extension has explicit guardrails: the system prompt forbids invented benchmarks and fake "tested" claims, every column the model mentions must appear verbatim in the schema section, indexes may only be proposed after checking the existing ones, and all DDL must be idempotent (&lt;code&gt;IF NOT EXISTS&lt;/code&gt; guards) so re-running a script is safe.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trickiest part: making a 7B model behave
&lt;/h2&gt;

&lt;p&gt;Two things I learned the hard way:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. LM Studio silently truncates long prompts from the FRONT.&lt;/strong&gt; The extension builds one prompt per question: system instructions + full schema text + rolling history + your question. If that prompt exceeds the model's context window, LM Studio doesn't error — it quietly drops the &lt;em&gt;beginning&lt;/em&gt;, which means the system message and the entire schema disappear, and the model starts answering with generic advice that ignores your actual database. The extension keeps the whole prompt under a character budget (dropping oldest history first, then shortening the schema), and auto-detects the real context window on overflow to retry.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Thinking models can burn the whole budget on reasoning and return an empty answer.&lt;/strong&gt; The extension strips inline &lt;code&gt;&amp;lt;think&amp;gt;&lt;/code&gt; blocks, flags truncated answers, and — worst case — recovers the last complete SQL block from the model's &lt;code&gt;reasoning_content&lt;/code&gt; instead of just showing you nothing.&lt;/p&gt;

&lt;p&gt;That's the part nobody tells you about local LLMs: the model is the easy bit. Keeping its context intact is the engineering.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup: 10 minutes, no credit card
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Install &lt;strong&gt;LM Studio&lt;/strong&gt;, download a 7B model (I like Qwen2.5-Coder-7B-Instruct for T-SQL), and start the local server.&lt;/li&gt;
&lt;li&gt;Download &lt;code&gt;SsmsAiAssistant.vsix&lt;/code&gt; from the repo's &lt;strong&gt;Releases&lt;/strong&gt; page (CI builds it automatically) and double-click to install — per-user, no admin rights.&lt;/li&gt;
&lt;li&gt;Start SSMS 21 &amp;amp; 22 → you'll see the &lt;strong&gt;Arman AI Assistant&lt;/strong&gt; menu next to &lt;em&gt;Tools&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Open the chat, then &lt;strong&gt;Tools → Options → Arman AI Assistant&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. AI Backend
   Base URL:  http://localhost:1234/v1     ← LM Studio
   API key:   lm-studio                    ← any non-empty string
   Model:     qwen2.5-coder-7b-instruct
2. Database Connection
   Active SSMS connection (or a custom connection string)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the backend is plain OpenAI-compatible, the &lt;em&gt;same&lt;/em&gt; extension also works with Ollama, vLLM, DeepSeek, Azure OpenAI or OpenAI itself — switchable in Options. Local is just the mode where nobody sees your data and nobody bills you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: the same database, via MCP
&lt;/h2&gt;

&lt;p&gt;The repo also ships a small .NET 8 &lt;strong&gt;MCP server&lt;/strong&gt; (stdio, official SDK) exposing 14 SQL tools — &lt;code&gt;list_tables&lt;/code&gt;, &lt;code&gt;describe_table&lt;/code&gt;, &lt;code&gt;sample_data&lt;/code&gt;, &lt;code&gt;execute_sql&lt;/code&gt;, ... — so Claude Desktop, Cursor or Claude Code can work against the same SQL Server with the same guardrails. Two components, one solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to get it
&lt;/h2&gt;

&lt;p&gt;The whole thing is MIT-licensed and open source:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;👉 &lt;a href="https://github.com/Fargo4u/ssms-ai-assistant" rel="noopener noreferrer"&gt;github.com/Fargo4u/ssms-ai-assistant&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Grab the ready-made VSIX from Releases, or build it yourself with Visual Studio 2022. If it saves you a few &lt;code&gt;SELECT&lt;/code&gt; round-trips or finds you a missing index, a ⭐ on the repo genuinely helps other SQL people find it — and issues/PRs are very welcome.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What would you want an AI assistant to do inside SSMS? Tell me in the comments — feature requests are the fuel here.&lt;/em&gt; 🚀&lt;/p&gt;

</description>
      <category>ai</category>
      <category>dotnet</category>
      <category>showdev</category>
      <category>sqlserver</category>
    </item>
  </channel>
</rss>
