AgentStack
SKILL verified MIT Self-run

Sqlserver Expert

skill-cuongtl1992-vibe-skills-sqlserver-expert · by cuongtl1992

Expert in Microsoft SQL Server development and administration. Use when writing T-SQL queries, stored procedures, functions, triggers, optimizing database performance (deadlocks, slow queries, execution plans, index tuning), designing schemas, configuring SQL Server, implementing CDC (Change Data Capture), or integrating SQL Server with .NET Core/C# using Entity Framework Core or Dapper. Also use…

No reviews yet
0 installs
14 views
0.0% view→install

Install

$ agentstack add skill-cuongtl1992-vibe-skills-sqlserver-expert

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Sqlserver Expert? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

SQL Server Expert

Act as DBA and developer expert in Microsoft SQL Server.

Quick Reference

CTEs with Window Functions

WITH RankedData AS (
  SELECT Id, Name, Department,
    ROW_NUMBER() OVER (PARTITION BY Department ORDER BY HireDate) AS RowNum,
    SUM(Salary) OVER (PARTITION BY Department) AS DeptTotal
  FROM Employees
)
SELECT * FROM RankedData WHERE RowNum = 1;

MERGE Statement

MERGE INTO Target AS t
USING Source AS s ON t.Id = s.Id
WHEN MATCHED THEN UPDATE SET t.Name = s.Name
WHEN NOT MATCHED THEN INSERT (Id, Name) VALUES (s.Id, s.Name)
WHEN NOT MATCHED BY SOURCE THEN DELETE;

Pagination

SELECT * FROM Orders ORDER BY OrderDate DESC
OFFSET @PageSize * (@PageNumber - 1) ROWS FETCH NEXT @PageSize ROWS ONLY;

Best Practices

Performance

  1. Avoid SELECT * - list columns explicitly
  2. Use appropriate indexes for WHERE/JOIN columns
  3. Avoid functions on columns in WHERE (not sargable)
  4. Use SET NOCOUNT ON in stored procedures
  5. Use OPTION (RECOMPILE) for parameter-sensitive queries

Security

  1. Never concatenate strings - use parameters
  2. Least privilege for application users
  3. Use schemas to organize and control access

Detailed References

  • T-SQL Advanced Patterns: See [references/tsql-advanced.md](references/tsql-advanced.md)
  • .NET Core Integration: See [references/dotnet-integration.md](references/dotnet-integration.md)
  • Performance Tuning & Deadlocks: See [references/performance.md](references/performance.md)
  • Change Data Capture (CDC): See [references/cdc.md](references/cdc.md)
  • System Queries & Metadata: See [references/system-queries.md](references/system-queries.md)

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.