<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/claude-on-sql-server-read-prove-then-change-khvdkejej" -->

---
title: Claude on SQL Server: Read, Prove, Then Change | daily.dev
description: A read-only Claude login lets it investigate SQL Server performance without touching production table rows. The three-stage setup starts with a read-only login...
canonical: https://daily.dev/posts/claude-on-sql-server-read-prove-then-change-khvdkejej
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Claude on SQL Server: Read, Prove, Then Change | daily.dev
og:description: A read-only Claude login lets it investigate SQL Server performance without touching production table rows. The three-stage setup starts with a read-only login...
og:url: https://daily.dev/posts/claude-on-sql-server-read-prove-then-change-khvdkejej
og:image: https://api.daily.dev/og/posts/KhvDkEjEj.png
og:image:alt: Claude on SQL Server: Read, Prove, Then Change
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude on SQL Server: Read, Prove, Then Change

**[SQL Authority](https://daily.dev/sources/sql-authority)** · 8 min read · 0 upvotes · 0 comments

## Summary

A read-only Claude login lets it investigate SQL Server performance without touching production table rows. The three-stage setup starts with a read-only login plus a staging copy, then grows into a daily habit backed by a library of past cases, then a scheduled, API-driven routine. The read-only login grants VIEW SERVER STATE, VIEW ANY DEFINITION, VIEW DATABASE STATE and SHOWPLAN, and in a test on SQL Server 2025 every SELECT on a table failed with Msg 229. The library uses retrieval augmented generation (RAG) so Claude can search past cases. In the advanced setup, both Claude and OpenAI's Codex review evidence, and a fix moves ahead when both agree, with a DBA settling any difference.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.sqlauthority.com/2026/10/29/claude-on-sql-server-read-prove-then-change>

## Questions this post answers

### What permissions should I grant a read-only SQL Server login for an AI assistant like Claude to analyze performance?

Grant VIEW SERVER STATE and VIEW ANY DEFINITION at the server level, then VIEW DATABASE STATE and SHOWPLAN in each database the assistant should read. On SQL Server 2022 and later, VIEW SERVER PERFORMANCE STATE is a narrower alternative. Testing this login on SQL Server 2025 confirmed it could read waits, plans and Query Store while every SELECT on a table failed with error Msg 229.

_Teams wiring up safe AI database access can compare setups like this one on daily.dev._

### How can I use Claude or another LLM to find and test SQL Server performance fixes without risking production?

Use a three-stage loop: a read-only production login generates a daily morning report of top waits, slow queries from Query Store, plan changes and blocking, each finding paired with a hypothesis and a test. The hypothesis gets tested on a staging copy, with results saved as a 'replay pack' (notes, queries, plans, baseline metrics, fix and rollback script). A person reviews the evidence before anything ships to production.

_Developers building AI-assisted ops workflows can track approaches like this on daily.dev._

### What is a replay pack in the context of database performance investigations?

A replay pack is a saved folder documenting one performance investigation, including notes.md describing the idea and result, the query and parameters tested, plan-before and plan-after execution plans, a baseline.csv of time, CPU and reads, the tested change.sql fix, and a rollback.sql to undo it. Even rejected ideas get a pack, which prevents the team from testing the same wrong idea twice.

_Anyone building a performance-tuning knowledge base can find similar documentation patterns on daily.dev._

## Similar posts on daily.dev

- [Operate with confidence: check production with your coding agent](https://daily.dev/posts/operate-with-confidence-check-production-with-your-coding-agent-kufjusedj) · Supabase · 0 upvotes · 0 comments
- [I gave my coding agent read-only access to my server and it started fixing actual bugs](https://daily.dev/posts/i-gave-my-coding-agent-read-only-access-to-my-server-and-it-started-fixing-actual-bugs-xhg5hozew) · XDA Developers · 0 upvotes · 0 comments
- [AI in Production Without a WHERE Clause](https://daily.dev/posts/ai-in-production-without-a-where-clause-suaczcnj5) · SQL Authority · 135 upvotes · 10 comments
- [Ontogeny Recapitulates the Relcache](https://daily.dev/posts/ontogeny-recapitulates-the-relcache-1cbthmvyn) · Planet PostgreSQL · 8 upvotes · 1 comments
- [Claude Skills](https://daily.dev/posts/claude-skills-cc0t7hjf8) · RUBYLAND · 1 upvotes · 0 comments

---

Tags: [#ai-coding](https://daily.dev/tags/ai-coding), [#claude](https://daily.dev/tags/claude), [#microsoft-sql-server](https://daily.dev/tags/microsoft-sql-server)

[View this post on daily.dev](https://daily.dev/posts/claude-on-sql-server-read-prove-then-change-khvdkejej)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Claude on SQL Server: Read, Prove, Then Change","url":"https://daily.dev/posts/claude-on-sql-server-read-prove-then-change-khvdkejej","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/claude-on-sql-server-read-prove-then-change-khvdkejej"},"datePublished":"2026-10-29T01:32:08.717Z","dateModified":"2026-10-29T01:32:40.410Z","description":"A read-only Claude login lets it investigate SQL Server performance without touching production table rows. The three-stage setup starts with a read-only login...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9ca50217b12166e902004983962c865e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9ca50217b12166e902004983962c865e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"SQL Authority","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"SQL Authority","logo":"https://media.daily.dev/image/upload/s--reCGnvgi--/f_auto,q_auto/v1780213436/logos/sql-authority?_a=BAMAMiWQ0","url":"https://daily.dev/sources/sql-authority"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/claude-on-sql-server-read-prove-then-change-khvdkejej","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-coding,claude,microsoft-sql-server","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"SQL Authority","item":"https://daily.dev/sources/sql-authority"},{"@type":"ListItem","position":3,"name":"Claude on SQL Server: Read, Prove, Then Change"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/claude-on-sql-server-read-prove-then-change-khvdkejej#faq","mainEntity":[{"@type":"Question","name":"What permissions should I grant a read-only SQL Server login for an AI assistant like Claude to analyze performance?","acceptedAnswer":{"@type":"Answer","text":"Grant VIEW SERVER STATE and VIEW ANY DEFINITION at the server level, then VIEW DATABASE STATE and SHOWPLAN in each database the assistant should read. On SQL Server 2022 and later, VIEW SERVER PERFORMANCE STATE is a narrower alternative. Testing this login on SQL Server 2025 confirmed it could read waits, plans and Query Store while every SELECT on a table failed with error Msg 229. Teams wiring up safe AI database access can compare setups like this one on daily.dev."}},{"@type":"Question","name":"How can I use Claude or another LLM to find and test SQL Server performance fixes without risking production?","acceptedAnswer":{"@type":"Answer","text":"Use a three-stage loop: a read-only production login generates a daily morning report of top waits, slow queries from Query Store, plan changes and blocking, each finding paired with a hypothesis and a test. The hypothesis gets tested on a staging copy, with results saved as a 'replay pack' (notes, queries, plans, baseline metrics, fix and rollback script). A person reviews the evidence before anything ships to production. Developers building AI-assisted ops workflows can track approaches like this on daily.dev."}},{"@type":"Question","name":"What is a replay pack in the context of database performance investigations?","acceptedAnswer":{"@type":"Answer","text":"A replay pack is a saved folder documenting one performance investigation, including notes.md describing the idea and result, the query and parameters tested, plan-before and plan-after execution plans, a baseline.csv of time, CPU and reads, the tested change.sql fix, and a rollback.sql to undo it. Even rejected ideas get a pack, which prevents the team from testing the same wrong idea twice. Anyone building a performance-tuning knowledge base can find similar documentation patterns on daily.dev."}}]}
```

