| title | CLR User-Defined Functions | |||||
|---|---|---|---|---|---|---|
| description | SQL Server CLR integration allows you to create user-defined scalar-valued, table-valued, and aggregate functions in any .NET Framework programming language. | |||||
| author | rwestMSFT | |||||
| ms.author | randolphwest | |||||
| ms.date | 03/14/2017 | |||||
| ms.service | sql | |||||
| ms.subservice | clr | |||||
| ms.topic | reference | |||||
| helpviewer_keywords |
|
|||||
| ms.assetid | 6f7491f1-9a46-4146-ae09-056248634de2 |
[!INCLUDE SQL Server] User-defined functions are routines that can take parameters, perform calculations or other actions, and return a result. Beginning with [!INCLUDEssVersion2005], you can write user-defined functions in any [!INCLUDEmsCoName] .NET Framework programming language, such as [!INCLUDEmsCoName] Visual Basic .NET or [!INCLUDEmsCoName] Visual C#.
There are two types of functions: scalar, which returns a single value, and table-valued, which returns a set of rows.
The following table lists the topics in this section.
CLR Scalar-Valued Functions
Covers implementation requirements and examples of scalar-valued functions.
CLR Table-Valued Functions
Discusses how to implement and use table-valued functions (TVFs), as well as differences between [!INCLUDEtsql] and common language runtime (CLR) TVFs.
CLR User-Defined Aggregates
Describes how to implement and use user-defined aggregates.