Copilot’s New Agent Mode Lets SSMS Talk Back to Your Database
Microsoft just dropped a public preview that turns GitHub Copilot inside SQL Server Management Studio from a passive autocomplete helper into something that can actually do things. Instead of suggesting a single query, Agent Mode lets Copilot run multi-step diagnostics, tune performance, review security, and even alter schema — all while asking for your approval before touching anything.
What’s Actually New
Up until now, Copilot in SSMS worked like Copilot everywhere else: you type a comment, it guesses the next line. Useful, but limited. Agent Mode changes the model entirely. You give it a high-level goal like “find the slowest queries in AdventureWorks and suggest index changes,” and Copilot iterates through the problem itself. It runs diagnostics, parses execution plans, generates CREATE INDEX statements, and presents them for your review before executing anything.
According to Microsoft’s documentation, the agent can investigate performance problems, tune queries, review maintenance and configuration, identify security concerns, troubleshoot errors, and assist with operations. It runs steps until the goal is met, pausing for explicit approval before any query execution or schema change.
Why This Matters
DBAs and SQL developers spend a disproportionate amount of time on the same diagnostic loop: spot a slow query, check the execution plan, guess at an index, test it, repeat. Agent Mode automates that loop. It doesn’t remove the human from the decision — it removes the grunt work. You still approve every change, but you’re no longer the one manually running SET SHOWPLAN_XML ON and parsing the output.
This is also a signal about where Microsoft is taking Copilot broadly. Agent mode started in VS Code, hit Visual Studio proper, and now it’s landing in SQL tooling. The pattern is clear: Copilot is graduating from code completion to autonomous problem-solving, and database administration is a natural fit because the feedback loop (run query, check result, iterate) is well-defined and low-risk when gated by human approval.
Getting Started
- Update SSMS. You need SSMS 22.7 or newer. Install or update via the SSMS installer.
- Sign in to Copilot. Click the GitHub Copilot icon in SSMS and authenticate with your GitHub account. A GitHub Copilot subscription is required.
- Switch to Agent Mode. In the Copilot chat pane, pick
Agentfrom the mode dropdown. Make sure thesql-toolsextension collection is enabled. - Give it a real task. Instead of “write a query,” try “analyze the execution plan for usp_GetSalesReport and recommend index changes.” Copilot will work through the problem step by step.
Concrete Examples
- Performance tuning. Ask Copilot to “find the top 5 most expensive queries in the current database and suggest indexes.” It will query
sys.dm_exec_query_stats, analyze the plans, and proposeCREATE INDEXstatements. - Security audits. “List all users with write access to the Sales schema and flag any that violate least-privilege.” Copilot can enumerate roles and permissions across the database.
- Error investigation. Paste an error message and ask Copilot to “query
sys.messagesand the error log to find the root cause.” It will iteratively search until it has a diagnosis. - Schema changes. “Add a computed column for TotalPrice to the OrderDetails table.” Copilot generates the
ALTER TABLEscript and lets you review before execution.
Bottom Line
Agent Mode in SSMS is in public preview, so expect rough edges and missing features. But the direction is right. For teams running large OLTP workloads, the ability to offload the diagnostic loop to an AI — while keeping human approval on every change — could meaningfully reduce incident response time and query optimization cycles. Sign in, switch to Agent, and see if it earns a spot in your workflow.