| title | CLR User-Defined Functions | Microsoft Docs | |||||
|---|---|---|---|---|---|---|
| ms.custom | ||||||
| ms.date | 03/14/2017 | |||||
| ms.prod | sql | |||||
| ms.prod_service | database-engine | |||||
| ms.component | clr | |||||
| ms.reviewer | ||||||
| ms.suite | sql | |||||
| ms.technology | ||||||
| ms.tgt_pltfrm | ||||||
| ms.topic | reference | |||||
| helpviewer_keywords |
|
|||||
| ms.assetid | 6f7491f1-9a46-4146-ae09-056248634de2 | |||||
| caps.latest.revision | 46 | |||||
| author | rothja | |||||
| ms.author | jroth | |||||
| manager | craigg |
[!INCLUDEappliesto-ss-xxxx-xxxx-xxx-md] 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.