Back to Skills

tsql-functions

verified

Complete T-SQL function reference for SQL Server and Azure SQL Database. Use this skill when: (1) User asks about T-SQL string, date, math, or conversion functions, (2) User needs help with window/ranking functions, (3) User works with JSON or XML in T-SQL, (4) User asks about aggregate functions or GROUP BY, (5) User needs system or metadata functions.

View on GitHub

Marketplace

claude-plugin-marketplace

JosiahSiegel/claude-plugin-marketplace

Plugin

tsql-master

Repository

JosiahSiegel/claude-plugin-marketplace
7stars

plugins/tsql-master/skills/tsql-functions/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/JosiahSiegel/claude-plugin-marketplace/blob/main/plugins/tsql-master/skills/tsql-functions/SKILL.md -a claude-code --skill tsql-functions

Installation paths:

Claude
.claude/skills/tsql-functions/
Powered by add-skill CLI

Instructions

# T-SQL Functions Reference

Complete reference for all T-SQL function categories with version-specific availability.

## Quick Reference

### String Functions
| Function | Description | Version |
|----------|-------------|---------|
| `CONCAT(str1, str2, ...)` | NULL-safe concatenation | 2012+ |
| `CONCAT_WS(sep, str1, ...)` | Concatenate with separator | 2017+ |
| `STRING_AGG(expr, sep)` | Aggregate strings | 2017+ |
| `STRING_SPLIT(str, sep)` | Split to rows | 2016+ |
| `STRING_SPLIT(str, sep, 1)` | With ordinal column | 2022+ |
| `TRIM([chars FROM] str)` | Remove leading/trailing | 2017+ |
| `TRANSLATE(str, from, to)` | Character replacement | 2017+ |
| `FORMAT(value, format)` | .NET format strings | 2012+ |

### Date/Time Functions
| Function | Description | Version |
|----------|-------------|---------|
| `DATEADD(part, n, date)` | Add interval | All |
| `DATEDIFF(part, start, end)` | Difference (int) | All |
| `DATEDIFF_BIG(part, s, e)` | Difference (bigint) | 2016+ |
| `EOMONTH(date, [offset])` | Last day of month | 2012+ |
| `DATETRUNC(part, date)` | Truncate to precision | 2022+ |
| `DATE_BUCKET(part, n, date)` | Group into buckets | 2022+ |
| `AT TIME ZONE 'tz'` | Timezone conversion | 2016+ |

### Window Functions
| Function | Description | Version |
|----------|-------------|---------|
| `ROW_NUMBER()` | Sequential unique numbers | 2005+ |
| `RANK()` | Rank with gaps for ties | 2005+ |
| `DENSE_RANK()` | Rank without gaps | 2005+ |
| `NTILE(n)` | Distribute into n groups | 2005+ |
| `LAG(col, n, default)` | Previous row value | 2012+ |
| `LEAD(col, n, default)` | Next row value | 2012+ |
| `FIRST_VALUE(col)` | First in window | 2012+ |
| `LAST_VALUE(col)` | Last in window | 2012+ |
| `IGNORE NULLS` | Skip NULLs in offset funcs | 2022+ |

### SQL Server 2022 New Functions
| Function | Description |
|----------|-------------|
| `GREATEST(v1, v2, ...)` | Maximum of values |
| `LEAST(v1, v2, ...)` | Minimum of values |
| `DATETRUNC(part, date)` | Truncate d

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4186 chars