AI agent toolkits for databases
Let your AI coding agent work on SQL Server without guessing.
SQL Rig for SQL Server is a pack of prompts for Cursor, Claude Code, and GitHub Copilot, plus 47 tested T-SQL and PowerShell files with guardrails built in. Dry-run by default. -WhatIf on PowerShell. No SSIS. Tested on SQL Server 2025.
The problem
Agents default to the wrong tools
Ask a general-purpose assistant for an ETL job and it often proposes SSIS or ad-hoc scripts instead of SQL Server Agent, linked servers, and stored procedures.
Generated scripts skip safety
Missing XACT_ABORT, no TRY/CATCH, unbatched deletes, and silent DROP statements are common in unreviewed output.
Every session starts from zero
Without written rules and reference scripts, you re-explain your conventions in every chat and review every line from scratch.
What is inside
47 files in five folders. Each script has a header with purpose, compatibility, required permissions, and a rollback note.
01-prompts (10)
agent-sql-dba-system.md
agent-cursor-rules.md
agent-claude-project.md
task-diagnose-blocking.md
task-write-agent-job.md
task-linked-server-safe.md
task-refactor-adhoc-to-proc.md
task-index-review.md
task-backup-restore-verify.md
task-security-audit-lite.md
02-tsql (19)
blocking-chain.sql
wait-stats-delta.sql
expensive-queries.sql
index-fragmentation-sample.sql
unused-indexes.sql
agent-job-create-template.sql
agent-job-steps-tsql-powershell.sql
agent-job-failure-alert.sql
agent-job-inventory.sql
linked-server-add.sql
linked-server-openquery.sql
linked-server-test.sql
proc-template-safe.sql
proc-idempotent-upsert.sql
proc-batch-loop-safe.sql
maintenance-stats-update.sql
permission-least-privilege.sql
orphaned-users-fix.sql
xp-cmdshell-check.sql
03-powershell (7)
Invoke-SqlSmokeTest.ps1
Export-AgentJobDefinitions.ps1
Invoke-SqlScriptFolder.ps1
Get-SqlBlockingSnapshot.ps1
Backup-SqlDatabase.ps1
Test-LinkedServer.ps1
Install-SqlAgentAlert.ps1
04-guardrails (4)
PROD-SAFETY.md
FORBIDDEN-PATTERNS.md
REVIEW-CHECKLIST.md
rollback-patterns.sql
05-sql2025-vector (3, preview)
README-vector.md
prompt-vector-rag-sql.md
vector-column-basics.sql
root (4)
README.md
QUICKSTART.md
CHANGELOG.md
LICENSE-BUYER.txt
Sample pattern
A simplified excerpt showing the conventions used across the pack: dry-run default, batching, and transactional error handling.
/* proc-batch-loop-safe.sql (excerpt) -- writes default to dry run */
SET XACT_ABORT ON;
DECLARE @DryRun bit = 1, @BatchSize int = 5000, @Rows int = 1;
IF @DryRun = 1
BEGIN
SELECT COUNT(*) AS rows_that_would_be_deleted
FROM dbo.AuditLog WHERE CreatedAt < DATEADD(day, -90, SYSUTCDATETIME());
RETURN;
END
WHILE @Rows > 0
BEGIN
BEGIN TRY
BEGIN TRAN;
DELETE TOP (@BatchSize) FROM dbo.AuditLog
WHERE CreatedAt < DATEADD(day, -90, SYSUTCDATETIME());
SET @Rows = @@ROWCOUNT;
COMMIT;
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0 ROLLBACK;
THROW;
END CATCH
END
Pricing
One-time payment. No subscription. Delivered as a ZIP through Gumroad.
Free teaser
$0
- 14 of the 47 files
- System prompt and quickstart
- 8 T-SQL, 2 PowerShell, 2 guardrail docs
Full pack
$39
- All 47 files, version 1.0
- Prompts for Cursor, Claude Code, Copilot
- All guardrails and rollback patterns
- SQL Server 2025 vector preview
Full pack + updates
$79
- Everything in the full pack
- 12 months of updates
- New versions delivered with a changelog
Coming next: SQL Rig for Postgres
A SQL Server to Postgres migration kit: prompts and scripts to help an AI agent translate T-SQL, map types, and verify data after cutover. Not available yet.
FAQ
What is SQL Rig for SQL Server?
A downloadable ZIP of 47 files: prompts for Cursor, Claude Code, and GitHub Copilot, plus T-SQL and PowerShell scripts with production guardrails for SQL Server Agent jobs, linked servers, stored procedures, diagnostics, and permissions.
Which SQL Server versions does it support?
Scripts were tested on SQL Server 2025. The compatibility baseline is SQL Server 2019 and later; scripts note where 2016 or Azure SQL Managed Instance also work. The vector folder targets SQL Server 2025 features and is marked preview.
Does it use SSIS?
No. The prompts instruct agents to use T-SQL, SQL Server Agent, linked servers, and PowerShell, and to avoid SSIS unless you explicitly ask for it.
How do the guardrails work?
T-SQL scripts that write default to @DryRun = 1 and use SET XACT_ABORT ON with TRY/CATCH. PowerShell scripts support -WhatIf through SupportsShouldProcess. There are no silent DROPs; destructive actions require explicit opt-in. A review checklist and rollback patterns are included.
What is in the free teaser?
14 files from the full pack: the system prompt, quickstart, 8 T-SQL scripts, 2 PowerShell scripts, and 2 guardrail documents. It costs $0.
What is the difference between the $39 and $79 tiers?
Both include the full 47-file pack. The $79 tier adds 12 months of updates, delivered as new versions with a changelog.
Do I need dbatools or other modules?
No. dbatools and the SqlServer PowerShell module are optional; every task has a path without dbatools.
Is there a Postgres version?
SQL Rig for Postgres, a SQL Server to Postgres migration kit, is planned next. It is not available yet.
Newsletter
A newsletter for release notes and the Postgres kit launch is coming soon. Signup is not open yet.