- Home
- Skills
- Data & Databases
- SQL Rig: SQL Server Toolkit for AI Agents
SQL Rig: SQL Server Toolkit for AI Agents
The full SQL Rig kit: 47 tested files that keep your AI agent safe on SQL Server, from multi-step Agent jobs and linked servers to batched deletes and index maintenance.
$49
Works with the AI Agents you already use
SQL Rig: SQL Server Toolkit for AI Agents
Example session with this skill installed
Create a nightly Agent job that runs dbo.usp_LoadOrders, then a PowerShell export step, and emails the DBA team if any step fails.
- Read your context and instructions
- Compiled the sql rig
The agent follows task-write-agent-job.md and fills agent-job-steps-tsql-powershell.sql and agent-job-failure-alert.sql with @DryRun = 1. It shows the printed plan: the job and category it will create, step 1 running dbo.usp_LoadOrders as T-SQL, step 2 running the PowerShell export, explicit on-success and on-failure flow between steps, the nightly schedule, and an operator plus alert that emails the DBA team when any step fails. It lists rollback steps (drop the job, schedule, alert, and operator by name), walks through the human review checklist, and only then suggests rerunning with @DryRun = 0. Nothing is created until you approve.
Connects securely to your tools. The creator never sees your data.
About this skill
SQL Rig is the toolkit I use to let AI agents work on production-adjacent SQL Server without guessing. It gives the agent strict rules, a task prompt for each common job, and tested T-SQL and PowerShell to start from. Every write defaults to dry run, every create is idempotent, and every script header states purpose, minimum version, permissions, and rollback.
What it does
- Loads DBA rules and a forbidden-patterns list. The agent rejects and rewrites output that matches a known bad pattern.
- Routes each request to a task prompt with defined steps and deliverables: blocking, Agent jobs, linked servers, proc refactors, index review, backup and restore, security audit.
- Starts from tested scripts instead of improvised SQL, and gives rollback steps for every change.
What's included (47 files)
- Prompts (10): DBA system prompt, Cursor rules, CLAUDE.md block, and 7 task prompts.
- T-SQL (19): blocking chains, expensive queries (plan cache and Query Store), wait stats delta, Agent job inventory and template, multi-step Agent jobs (T-SQL, PowerShell, and CmdExec steps with explicit success and failure flow), failure alerts and operators, linked-server add, test, and OPENQUERY patterns, batched DELETE and UPDATE with row caps, idempotent upsert, safe stored procedure template, least-privilege permission checks, orphaned users, unused indexes, sampled fragmentation with REORGANIZE or REBUILD plans, statistics maintenance, surface-area audit.
- PowerShell (7): smoke test, backup with CHECKSUM and VERIFYONLY, Agent job export, script-folder runner with per-file transactions, blocking snapshot to CSV or JSON, linked-server test, Agent alert installer. All support -WhatIf and never hardcode passwords.
- Guardrails (4): production safety rules, forbidden patterns, human review checklist, rollback templates.
- SQL Server 2025 vector preview (3): version-gated VECTOR column and DiskANN demo, RAG retrieval prompt, and notes that stop the agent from inventing vector syntax.
- Quickstart, changelog, license.
Requirements
- SQL Server 2016 or later, or Azure SQL Managed Instance. Most scripts target 2019 and later; headers state the minimum. Vector files need SQL Server 2025 or Azure SQL.
- PowerShell 5.1 or later. The SqlServer module and dbatools are optional.
- You run the scripts yourself. The skill never connects to a server.
Updates ship through Agensi to every buyer. Built by Scott Coffey, sqlrig.com.
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scanned
Verified clean 1 day ago
- Passed all security checks, Safe to install
Requires