sqlserver

Microsoft SQL Server with T-SQL, SSMS, and enterprise features. Use for Windows/Azure.

7 stars

Best use case

sqlserver is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Microsoft SQL Server with T-SQL, SSMS, and enterprise features. Use for Windows/Azure.

Teams using sqlserver should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/sqlserver/SKILL.md --create-dirs "https://raw.githubusercontent.com/G1Joshi/Agent-Skills/main/skills/databases/sqlserver/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/sqlserver/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How sqlserver Compares

Feature / AgentsqlserverStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Microsoft SQL Server with T-SQL, SSMS, and enterprise features. Use for Windows/Azure.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# SQL Server (MSSQL)

Microsoft SQL Server is an enterprise-grade RDBMS. It uses T-SQL (Transact-SQL), an extension of SQL that adds procedural programming, local variables, and data processing.

## When to Use

- **Enterprise .NET Stack**: Deep integration with C#, Azure, and Visual Studio.
- **Complex Analytics**: Built-in Analysis Services (SSAS) and Reporting (SSRS).
- **Corporate Environments**: Active Directory integration for security.

## Quick Start (T-SQL)

```sql
-- CTE and Window Function
WITH Sales_CTE AS (
    SELECT SalesPersonID, SUM(TotalDue) AS TotalSales
    FROM Sales.SalesOrderHeader
    GROUP BY SalesPersonID
)
SELECT SalesPersonID, TotalSales,
       RANK() OVER (ORDER BY TotalSales DESC) AS SalesRank
FROM Sales_CTE;
```

## Core Concepts

### T-SQL

Powerful procedural extensions.

```sql
DECLARE @Counter INT = 1;
WHILE @Counter <= 10
BEGIN
   PRINT @Counter;
   SET @Counter = @Counter + 1;
END
```

### SQL Agent

Built-in job scheduler for backups, maintenance, and scripts.

### Clustered Index

Organizes the data in the table physically. Usually the Primary Key. A table can likely have only one.

## Best Practices (2025)

**Do**:

- **Use AI Integration (2025)**: Call `sp_invoke_external_rest_endpoint` to integrate Azure OpenAI directly into queries.
- **Use `APPLY` operator**: `CROSS APPLY` is powerful for joining a table to a table-valued function.
- **Query Store**: Enable Query Store to track performance regressions over time automatically.

**Don't**:

- **Don't use cursors**: T-SQL set-based operations are almost always faster.
- **Don't use `NOLOCK` blindly**: It causes dirty reads. Use `READ COMMITTED SNAPSHOT` isolation instead.

## References

- [Microsoft SQL Docs](https://learn.microsoft.com/en-us/sql/sql-server/)