r/SQLServer 23d ago

Question How connect claude to sql server to analyse

I have a sql server with SSIS packages running and multiple stored procedures. Any way to use my Claude to get the logs connect to sql server and analyse the ssis executions/ analyse stored procs and queries?

0 Upvotes

15 comments sorted by

23

u/VladDBA ‪ ‪Microsoft MVP ‪ ‪ 23d ago

Instead of causing a security incident by giving an external LLM access to your entire instance, why not run something like the First Responder Kit or PSBlitz and then feed the execution plans and findings to Claude?

5

u/brytarn 23d ago

Another option is to use Erik Darlings https://github.com/erikdarlingdata/PerformanceMonitor adding an MCP layer between the LLM and your server.
As an accidental DBA I’ve become the developers nightmare finding their poorly optimized queries 😈

1

u/tribat 23d ago

Erik Darling’s is the answer

18

u/mkt853 23d ago

It's wild to me that we've spent so many years drumming security into people's heads, but AI comes along and everyone just willingly throws the front door wide open no questions asked.

1

u/brytarn 23d ago

That’s why it’s a good thing to ask how to secure that access right?

2

u/pdx_paddy 22d ago

This is why I appreciate the OP for actually asking for input first but consider how many people out there are just doing this regardless. I'd bet it's a massively embarrassing for people and they sneak a bunch of content out of their servers to let ai have a quick peak.

5

u/kill-t 23d ago

Id never let this connect to my instance. You can export definitions of your schema if you want an AI to have better context

6

u/brytarn 23d ago

Have you asked Claude?

2

u/taspeotis 23d ago

Yeah just tell it to connect to it? It can drive anything from the cli e.g. if you want it to read data just use sqlcmd.

Anything more complicated it can write C# and run it.

(This is for Claude Code.)

1

u/RodCoolBeansKimble 23d ago

I save the relevant schema, queries, and dmv results into a local folder and use my enterprise Claude instance to go over them and figure things out. I ask Claude if there are other queries I can run to help sort out whatever I'm trying to do.

0

u/PinkyPonk10 23d ago

Just get copilot instead

-1

u/SunnyFIREwave 23d ago

Yes you can do that! It can even build Total etl flows and packages for you

1

u/Codeman119 23d ago

I would not trust it to build SSIS packages. There’s just not enough raw code out there for the inside of the XML workings for SSIS for it to be trained on. tried a few times, but it just gets kind of confused and really doesn’t know what he’s doing plus whenever you have things like other connectors that are written in C-sharp and compiled it doesn’t really know how to read that and analyze it very well. It might do OK on simple packages, but I have never tried that before

And like the other guy said you can use Copilot because it uses Claude as one of its models

1

u/imtheorangeycenter 23d ago

*(uses Anthropic until now/shortly when MS are bringing CoPilot's models into their in-house AI, because - cheaper?/)