# User-Defined Functions in T-SQL

Write your own functions. A scalar function returns one value and works inside any query; a table-valued function returns rows and works like a table that takes parameters.

![Cheat sheet: User-Defined Functions in T-SQL](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/c62df863aa7343f78af1bfe36ab85b90.webp)

- Category: SQL
- Level: Journeyman
- Tags: dbo Schema, sql, Table-Valued Function, t-sql, User-Defined Function
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/user-defined-functions-in-t-sql-cheat-sheet
