| title | Common Language Runtime (CLR) Programming | |||||
|---|---|---|---|---|---|---|
| description | This article provides resources for using CLR integration with SQL Server, which allows you to write server-side modules using any .NET Framework language. | |||||
| author | rwestMSFT | |||||
| ms.author | randolphwest | |||||
| ms.date | 12/27/2024 | |||||
| ms.service | sql | |||||
| ms.subservice | clr | |||||
| ms.topic | reference | |||||
| helpviewer_keywords |
|
[!INCLUDE SQL Server SQL MI]
[!INCLUDE ssNoVersion] features the integration of the common language runtime (CLR) component of the [!INCLUDE dnprdnshort-md] for Windows.
You can write stored procedures, triggers, user-defined types, user-defined functions, user-defined aggregates, and streaming table-valued functions, using any language, including [!INCLUDE c-sharp-md] and [!INCLUDE visual-basic-md] .NET.
-
SQL Server CLR integration doesn't support .NET Core, or .NET 5 and later versions.
-
You can load CLR database objects for [!INCLUDE sssql17-md] and later versions on Linux, but they must be built with the [!INCLUDE dnprdnshort-md]. Also, CLR assemblies with the
EXTERNAL_ACCESSorUNSAFEpermission set aren't supported on Linux. -
By default, the [!INCLUDE dnprdnshort-md] runtime is installed with [!INCLUDE ssNoVersion], but the [!INCLUDE dnprdnshort-md] SDK isn't. To install the latest version of the [!INCLUDE dnprdnshort-md] SDK, see Download .NET Framework Developer Pack.
-
The
Microsoft.SqlServer.Servernamespace includes core functionality for CLR programming in [!INCLUDE ssNoVersion]. For documentation on theMicrosoft.SqlServer.Servernamespace, see Microsoft.SqlServer.Server Namespace (.NET Framework 4.8). -
CLR functionality, such as CLR user functions, aren't supported for Azure SQL Database.
The following table lists the articles in this section.
| Article | Description |
|---|---|
| Common language runtime (CLR) integration | Provides a brief overview of the CLR, and describes how and why this technology is used in [!INCLUDE ssNoVersion]. Describes the benefits of using the CLR to create database objects. |
| Assemblies (Database Engine) | Describes how assemblies are used in [!INCLUDE ssNoVersion] to deploy functions, stored procedures, triggers, user-defined aggregates, and user-defined types. These objects are written in one of the managed code languages hosted by the [!INCLUDE dnprdnshort-md] common language runtime (CLR), and not in [!INCLUDE tsql]. |
| Build database objects with common language runtime (CLR) integration | Describes the kinds of objects that can be built using the CLR, and reviews the requirements for building CLR database objects. |
| Data access from CLR database objects | Describes how a CLR routine can access data stored in an instance of [!INCLUDE ssNoVersion]. |
| CLR integration security | Describes the CLR integration security model. |
| How to debug CLR database objects | Describes limitations of and requirements for debugging CLR database objects. |
| Deploy CLR database objects | Describes deploying assemblies to production servers. |
| Manage CLR integration assemblies | Describes how to create and drop CLR integration assemblies. |
| Monitor and troubleshoot managed database objects | Provides information about the tools that can be used to monitor and troubleshoot managed database objects and assemblies running in [!INCLUDE ssNoVersion]. |
| Usage Scenarios and Examples for Common Language Runtime (CLR) Integration | Describes usage scenarios and code samples using CLR objects. |