--- title: "CLR User-Defined Functions | Microsoft Docs" ms.custom: "" ms.date: "03/14/2017" ms.prod: "sql-server-2016" ms.reviewer: "" ms.suite: "" ms.technology: - "docset-sql-devref" ms.tgt_pltfrm: "" ms.topic: "reference" helpviewer_keywords: - "building database objects [CLR integration], user-defined functions" - "functions [CLR integration]" - "common language runtime [SQL Server], user-defined functions" - "database objects [CLR integration], user-defined functions" - "user-defined functions [CLR integration]" ms.assetid: 6f7491f1-9a46-4146-ae09-056248634de2 caps.latest.revision: 46 author: "JennieHubbard" ms.author: "jhubbard" manager: "jhubbard" --- # CLR User-Defined Functions User-defined functions are routines that can take parameters, perform calculations or other actions, and return a result. Beginning with [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)], you can write user-defined functions in any [!INCLUDE[msCoName](../../includes/msconame-md.md)] .NET Framework programming language, such as [!INCLUDE[msCoName](../../includes/msconame-md.md)] Visual Basic .NET or [!INCLUDE[msCoName](../../includes/msconame-md.md)] 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](../../relational-databases/clr-integration-database-objects-user-defined-functions/clr-scalar-valued-functions.md) Covers implementation requirements and examples of scalar-valued functions. [CLR Table-Valued Functions](../../relational-databases/clr-integration-database-objects-user-defined-functions/clr-table-valued-functions.md) Discusses how to implement and use table-valued functions (TVFs), as well as differences between [!INCLUDE[tsql](../../includes/tsql-md.md)] and common language runtime (CLR) TVFs. [CLR User-Defined Aggregates](../../relational-databases/clr-integration-database-objects-user-defined-functions/clr-user-defined-aggregates.md) Describes how to implement and use user-defined aggregates. ## See Also [User-Defined Functions](../../relational-databases/user-defined-functions/user-defined-functions.md)