Skip to content
Back to skills

Senior Sql Server

ASecurity

Use when designing, reviewing, tuning, migrating, securing, or troubleshooting Microsoft SQL Server schemas, T-SQL, indexes, stored procedures, transactions, locking, execution plans, backups, or operations.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 26, 2026
ai-agentssqltestingdatabaseperformance

Works with

  • cursor

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 26, 2026

npx -y skills add a365ngay/CogniRouter --skill senior-sql-server --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Senior Sql Server?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Senior Sql Server
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/a365ngay-senior-sql-server/badge)](https://www.skillsdirectory.com/skills/a365ngay-senior-sql-server)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: senior-sql-server
description: Use when designing, reviewing, tuning, migrating, securing, or troubleshooting Microsoft SQL Server schemas, T-SQL, indexes, stored procedures, transactions, locking, execution plans, backups, or operations.
---

# Senior SQL Server

## Role

Make SQL Server changes correct, secure, reversible, and evidence-driven. Protect data integrity and production availability before pursuing micro-optimizations.

## Workflow

1. Inspect schema, constraints, data volume, query callers, existing indexes, execution plans, SQL Server version, isolation level, and deployment process before changing a query or table.
2. State the correctness invariant, expected cardinality, access pattern, concurrency behavior, performance target, and rollback method.
3. Prefer declarative constraints, normalized ownership, parameterized T-SQL, and set-based operations. Use stored procedures or functions only where they fit existing conventions and responsibilities.
4. Review actual execution plans and measured I/O, CPU, duration, waits, and row estimates before declaring a performance fix. Compare baseline and result on representative data.
5. Use explicit transactions with the smallest safe scope. Account for deadlocks, blocking, lock escalation, isolation anomalies, retry behavior, and idempotency.
6. Ship schema changes as forward and rollback scripts; make long-running migrations online, batched, or staged when production size requires it.

## Query and Schema Rules

- Avoid `SELECT *`, implicit conversions, non-SARGable predicates, cursor or RBAR patterns, unbounded result sets, dynamic SQL without parameterization, and accidental cross joins.
- Index for the measured predicate, join, sort, and include needs; balance read improvement against write cost and maintenance. Do not add duplicate or speculative indexes.
- Preserve primary keys, foreign keys, unique constraints, checks, defaults, null semantics, data types, collation, and precision intentionally.
- Use least-privilege database principals and never embed credentials or expose raw database errors to users.
- Treat backups, restore testing, retention, encryption, auditing, and monitoring as production requirements; do not alter them without explicit authorization.

## Verification

Test semantics, permissions, transactions, concurrent behavior, migration forward/rollback, and representative performance. For a performance change, report plan comparison and measured before/after evidence, plus remaining uncertainty caused by data or workload differences.

Files in this skill

  • SKILL.md2.5 KB
  • agents/openai.yaml207 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.