The Transact-SQL programming language provides three types of functions:
Can be used like table references in an SQL statement. For more information about a list of these functions, see Rowset Functions.
Operate on a collection of values but return a single, summarizing value. For more information about a list of these functions, see Aggregate Functions.
Operate on a single value and then return a single value. Scalar functions can be used wherever an expression is valid. This table categorizes the scalar functions.
Function category | Explanation |
---|---|
Configuration Functions | Returns information about the current configuration. |
Cursor Functions | Returns information about cursors. |
Date and Time Functions | Performs an operation on a date and time input value and returns either a string, numeric, or date and time value. |
Mathematical Functions | Performs a calculation based on input values provided as parameters to the function, and returns a numeric value. |
Metadata Functions | Returns information about the database and database objects. |
Security Functions | Returns information about users and roles. |
String Functions | Performs an operation on a string (char or varchar) input value and returns a string or numeric value. |
System Functions | Performs operations and returns information about values, objects, and settings in Microsoft® SQL Server™. |
System Statistical Functions | Returns statistical information about the system. |
Text and Image Functions | Performs an operation on a text or image input values or column, and returns information about the value. |