Six posts. That's how long it took me to go from skeptic to convinced on sp_BlitzCache + ChatGPT. If you missed that series, here's the recap: AI diagnosed two real performance problems from a single execution plan in < two minutes — and I stopped resisting AI in SQL Server. Here's the one that changed my mind.
Now Brent has opened the same door for sp_BlitzIndex. The March 2026 First Responder Kit release ships @AI support directly into sp_BlitzIndex. Point it at a table, and it comes back with prioritized index recommendations in Markdown — including the exact creation scripts and the undo scripts. I ran it. Here's what happened.
Before You Run Anything: Two Things to Check
First, if you set up sp_BlitzCache AI on the February 2026 release, you need to stop here. The March release has a breaking change where the single Blitz_AI config table has been split into two tables to support per-proc AI prompt configurations. Run Brent's migration script before installing the new version to get things up to speed.
Secondly, if you install your procs in a database other than the master db with an older compatibility level, you may see this:
Msg 102, Level 15, State 1, Procedure sp_BlitzIndex, Line 3844 Incorrect syntax near '$.message.content'.
It's not a bug in the FRK. It's a compatibility level issue. The fix is easy: install in the master database or confirm your target database is at compatibility level 150 or higher. Brent suggested this in the comments on his release post, and a commenter confirmed it resolved the error.
Two Modes. One Parameter.
| Parameter | What It Does | Requires |
|---|---|---|
@AI = 2 |
Builds the AI prompt for you to copy/paste into any AI of your choice | Any SQL Server version. No API key. Just a table name. |
@AI = 1 |
Calls ChatGPT or Gemini directly from SQL Server and returns the advice in your result set | SQL Server 2025 or Azure SQL DB. API key configured in the Blitz_AI tables. |
Start with @AI = 2. It lets you see exactly what gets sent to the AI before any data leaves your server. Once you've seen the prompt output and are comfortable with the call, @AI = 1 actually makes the AI exchange.
Step 1: @AI = 2 — Build the Prompt
The @TableName parameter is required when using sp_BlitzIndex with @AI. You cannot run it against an entire database. I'm running this against dbo.SalesOrder in my Orders database — one million rows, clustered on the primary key, light on nonclustered indexes. Good candidate for 'missing indexes'.
EXEC dbo.sp_BlitzIndex
@DatabaseName = 'Orders',
@SchemaName = 'dbo',
@TableName = 'SalesOrder',
@AI = 2;
SSMS Output
We get the standard sp_BlitzIndex output with details for existing and missing indexes, column data types and foreign keys — plus a new AI Prompt value in the resultset (highlighted). This contains the full prompt that sp_BlitzIndex is passing to the AI, existing index definitions plus SQL Server's own missing index suggestions, column data types, and foreign key relationships. No row data. No query plans. Schema and index metadata only.
This is just a snippet of the AI Prompt but you can see the full output here. Copy the output, paste it into ChatGPT, Gemini, Claude — whatever you use.
What the AI Sent Back
The response came back in Markdown. What I got: a prioritized list of index recommendations with reasoning for each one, an assessment of which SQL Server-suggested missing indexes to take as-is, which to combine, and which to skip, along with the full CREATE INDEX scripts ready to run and the corresponding DROP INDEX undo scripts for every recommendation.
The undo scripts are the part I didn't expect. If you're presenting index changes to a customer, showing up with both the change and the rollback already written is the kind of thing that builds trust fast. I didn't have to write either one.
Step 2: @AI = 1 — Make the call to AI
I set this up before with sp_BlitzCache, so @AI = 1 is available to me. If you already configured API credentials for sp_BlitzCache, the same setup works here — which is a key point of the new two-table structure. One setup works for both sp_BlitzCache and sp_BlitzIndex. If you haven't set up credentials yet, my BlitzCache setup post walks through the full API key and database-scoped credential process.
EXEC dbo.sp_BlitzIndex
@DatabaseName = 'Orders',
@SchemaName = 'dbo',
@TableName = 'SalesOrder',
@AI = 1;
Same syntax, different procedure. This time sp_BlitzIndex builds the prompt, calls the API directly via sp_invoke_external_rest_endpoint, and returns the AI's advice in your result set — without you leaving SSMS. Notice the difference from @AI = 2: the result set now includes four new columns — AI Advice, AI Prompt, AI Payload, and AI Raw Response — all returned directly in SSMS.
SSMS Output
The AI Advice column contains the full implementation-ready recommendation. Click into it and you get a prioritized plan: which indexes to drop, which to create, the exact CREATE INDEX and DROP INDEX scripts, and undo scripts for every change. All of it, right there in your SSMS output.
Another snippet, but you can view the full AI Advice output for this run here.
What It's Actually Sending to the AI
Worth understanding before you run this in a client environment. The system prompt Brent baked into sp_BlitzIndex instructs the model to behave like this:
'You are a very senior database developer working with Microsoft SQL Server and Azure SQL DB. You focus on real-world, actionable advice that will make a big difference, quickly. You value everyone's time, and while you are friendly and courteous, you do not waste time with pleasantries or emoji because you work in a fast-paced corporate environment. Do not describe the table: you are working with other very senior database developers who understand SQL Server deeply, so get straight to the point with your recommendations and scripts.'
Kudos to Brent. No pleasantries. No emoji. Just get-to-the-point recommendations and scripts. I respect that. The data payload it sends is: existing index definitions, SQL Server's missing index suggestions, column data types, and foreign keys. No actual data rows leave your server.
That said, if you use a hosted model like ChatGPT or Gemini, your schema metadata is traveling to a cloud endpoint. That means table names, column names, data types and key structure. For most environments, that's acceptable, but if you're in a regulated shop where even schema metadata is sensitive, know that before you run @AI = 1. As Brent said when someone asked him what sensitive information gets to AI: 'Depends on what AI service you choose to use. That's on you, son.'
The Part That Still Requires a Human
Much like I said in my BlitzCache series: AI didn't replace anything. It accelerated the starting point. Every recommendation it returned, I reviewed against the actual workload before touching a production index. SQL Server's own missing index suggestions are notoriously greedy — they optimize for the query that generated them, not for the table as a whole. The AI takes those suggestions as input and applies judgment. This is much better than taking them raw, but still not a substitute for knowing your environment.
What it saved me: Time. The prompt-to-recommendation cycle on a table I already knew took under two minutes. The undo scripts were already written. The Markdown output went straight into a client deliverable without reformatting. That is a true time saver and a real value.
Go Get the March 2026 FRK
Download at brentozar.com/first-aid, or PowerShell:
Install-DbaFirstResponderKit -SqlInstance YourServerName -Database master
If you already set up sp_BlitzCache AI, be sure to run the migration script first or things will break.
Pick a table you already know has index problems. Run it with @AI = 2 first — no risk, just instant results. See what the prompt looks like and what comes back. Then decide if @AI = 1 is worth the API setup for your environment. For me, on SQL Server 2025 with credentials already configured: Yes. Absolutely. Do it.
More to Read:
Updated First Responder Kit for March 2026 — Brent Ozar
Blitz_AI migration script — GitHub Gist
sp_BlitzCache Can Talk to ChatGPT Now. Here's How. — sqlfingers.com
sp_BlitzCache + ChatGPT: I'm Convinced. — sqlfingers.com
sp_invoke_external_rest_endpoint — Microsoft Learn











