|
1 | 1 | --- |
2 | | -title: "Common Language Runtime (CLR) Programming" |
| 2 | +title: "Common language runtime (CLR) programming" |
3 | 3 | 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. |
4 | 4 | author: rwestMSFT |
5 | 5 | ms.author: randolphwest |
6 | | -ms.date: "03/16/2017" |
| 6 | +ms.reviewer: randolphwest |
| 7 | +ms.date: 11/25/2022 |
7 | 8 | ms.service: sql |
8 | 9 | ms.subservice: clr |
9 | 10 | ms.topic: "reference" |
10 | | -ms.custom: "seo-lt-2019" |
| 11 | +ms.custom: seo-lt-2019 |
11 | 12 | helpviewer_keywords: |
12 | 13 | - "CLR [SQL Server] See common language runtime [SQL Server]" |
13 | 14 | - "Database Engine [SQL Server], .NET Framework" |
14 | 15 | - ".NET Framework [SQL Server], Database Engine programming" |
15 | 16 | - "common language runtime [SQL Server]" |
16 | 17 | - ".NET Framework [SQL Server]" |
17 | | -ms.assetid: 951bf851-3e6e-4361-ae6a-2bcd5b837ebd |
18 | 18 | --- |
19 | | -# Common Language Runtime (CLR) Integration Programming Concepts |
| 19 | +# Common language runtime (CLR) integration programming concepts |
| 20 | + |
20 | 21 | [!INCLUDE [SQL Server SQL MI](../../includes/applies-to-version/sql-asdbmi.md)] |
21 | | - Beginning with [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)], [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] features the integration of the common language runtime (CLR) component of the .NET Framework for [!INCLUDE[msCoName](../../includes/msconame-md.md)] Windows. This means that you can now write stored procedures, triggers, user-defined types, user-defined functions, user-defined aggregates, and streaming table-valued functions, using any .NET Framework language, including [!INCLUDE[msCoName](../../includes/msconame-md.md)] Visual Basic .NET and [!INCLUDE[msCoName](../../includes/msconame-md.md)] Visual C#. |
22 | | - |
23 | | - The Microsoft.SqlServer.Server namespace includes core functionality for CLR programming in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. However, the Microsoft.SqlServer.Server namespace is documented in the .NET Framework SDK. This documentation is not included in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Books Online. |
24 | | - |
| 22 | + |
| 23 | +Beginning with [!INCLUDE[ssVersion2005](../../includes/ssversion2005-md.md)], [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] features the integration of the common language runtime (CLR) component of the .NET Framework for [!INCLUDE[msCoName](../../includes/msconame-md.md)] Windows. |
| 24 | + |
| 25 | +You can write stored procedures, triggers, user-defined types, user-defined functions, user-defined aggregates, and streaming table-valued functions, using any .NET Framework language, including Visual Basic and C#. |
| 26 | + |
25 | 27 | > [!IMPORTANT] |
26 | | -> By default, the .NET Framework is installed with [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], but the .NET Framework SDK is not. Without the SDK installed on your computer and included in the Books Online collection, links to SDK content in this section do not work. Install the .NET Framework SDK. Once installed, add the SDK to the Books Online collection and table of contents by following the instructions in [Installing the .NET Framework SDK](https://technet.microsoft.com/library/bb686823\(v=SQL.105\).aspx). |
27 | | - |
| 28 | +> You can load CLR database objects for [!INCLUDE [sssql17-md](../../includes/sssql17-md.md)] and later versions on Linux, but they must be built with the .NET Framework. Also, CLR assemblies with the `EXTERNAL_ACCESS` or `UNSAFE` permission set are not supported on Linux. SQL Server CLR integration does not support .NET Core, or .NET 5 and later versions. |
| 29 | +
|
| 30 | +By default, the .NET Framework *runtime* is installed with [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], but the .NET Framework SDK is not. To install the latest version of the .NET Framework SDK, see [Download .NET Framework Developer Pack](https://dotnet.microsoft.com/download/dotnet-framework). |
| 31 | + |
| 32 | +The `Microsoft.SqlServer.Server` namespace includes core functionality for CLR programming in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. For documentation on the `Microsoft.SqlServer.Server` namespace, see [Microsoft.SqlServer.Server Namespace (.NET Framework 4.8)](/dotnet/api/microsoft.sqlserver.server?view=netframework-4.8&preserve-view=true). |
| 33 | + |
28 | 34 | > [!NOTE] |
29 | | -> CLR functionality, such as CLR user functions, are *not* supported for Azure SQL Database. |
30 | | - |
31 | | - The following table lists the topics in this section. |
32 | | - |
33 | | - [Common Language Runtime (CLR) Integration Overview](../../relational-databases/clr-integration/common-language-runtime-integration-overview.md) |
34 | | - Provides a brief overview of the CLR, and describes how and why this technology has been used in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Describes the benefits of using the CLR to create database objects. |
35 | | - |
36 | | - [Assemblies (Database Engine)](../../relational-databases/clr-integration/assemblies-database-engine.md) |
37 | | - Describes how assemblies are used in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] to deploy functions, stored procedures, triggers, user-defined aggregates, and user-defined types that are written in one of the managed code languages hosted by the [!INCLUDE[msCoName](../../includes/msconame-md.md)] .NET Framework common language runtime (CLR), and not written in [!INCLUDE[tsql](../../includes/tsql-md.md)]. |
38 | | - |
39 | | - [Building Database Objects with Common Language Runtime (CLR) Integration](../../relational-databases/clr-integration/database-objects/building-database-objects-with-common-language-runtime-clr-integration.md) |
40 | | - Describes the kinds of objects that can be built using the CLR, and reviews the requirements for building CLR database objects. |
41 | | - |
42 | | - [Data Access from CLR Database Objects](../../relational-databases/clr-integration/data-access/data-access-from-clr-database-objects.md) |
43 | | - Describes how a CLR routine can access data stored in an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. |
44 | | - |
45 | | - [CLR Integration Security](../../relational-databases/clr-integration/security/clr-integration-security.md) |
46 | | - Describes the CLR integration security model. |
47 | | - |
48 | | - [Debugging CLR Database Objects](../../relational-databases/clr-integration/debugging-clr-database-objects.md) |
49 | | - Describes limitations of and requirements for debugging CLR database objects. |
50 | | - |
51 | | - [Deploying CLR Database Objects](../../relational-databases/clr-integration/deploying-clr-database-objects.md) |
52 | | - Describes deploying assemblies to production servers. |
53 | | - |
54 | | - [Managing CLR Integration Assemblies](../../relational-databases/clr-integration/assemblies/managing-clr-integration-assemblies.md) |
55 | | - Describes how to create and drop CLR integration assemblies. |
56 | | - |
57 | | - [Monitoring and Troubleshooting Managed Database Objects](../../relational-databases/clr-integration/monitoring-and-troubleshooting-managed-database-objects.md) |
58 | | - Provides information about the tools that can be used to monitor and troubleshoot managed database objects and assemblies running in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. |
59 | | - |
60 | | - [Usage Scenarios and Examples for Common Language Runtime (CLR) Integration](/previous-versions/sql/sql-server-2016/ms131078(v=sql.130)) |
61 | | - Describes usage scenarios and code samples using CLR objects. |
62 | | - |
63 | | -## See Also |
64 | | - [Assemblies (Database Engine)](../../relational-databases/clr-integration/assemblies-database-engine.md) |
65 | | - [Installing the .NET Framework SDK](https://technet.microsoft.com/library/bb686823\(v=SQL.105\).aspx) |
66 | | - |
| 35 | +> CLR functionality, such as CLR user functions, are *not* supported for Azure SQL Database. |
| 36 | +
|
| 37 | +The following table lists the articles in this section. |
| 38 | + |
| 39 | +| Article | Description | |
| 40 | +| --- | --- | |
| 41 | +| [Common Language Runtime (CLR) Integration Overview](../../relational-databases/clr-integration/common-language-runtime-integration-overview.md) | Provides a brief overview of the CLR, and describes how and why this technology has been used in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. Describes the benefits of using the CLR to create database objects. | |
| 42 | +| [Assemblies (Database Engine)](../../relational-databases/clr-integration/assemblies-database-engine.md) | Describes how assemblies are used in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] to deploy functions, stored procedures, triggers, user-defined aggregates, and user-defined types that are written in one of the managed code languages hosted by the [!INCLUDE[msCoName](../../includes/msconame-md.md)] .NET Framework common language runtime (CLR), and not written in [!INCLUDE[tsql](../../includes/tsql-md.md)]. | |
| 43 | +| [Building Database Objects with Common Language Runtime (CLR) Integration](../../relational-databases/clr-integration/database-objects/building-database-objects-with-common-language-runtime-clr-integration.md) | Describes the kinds of objects that can be built using the CLR, and reviews the requirements for building CLR database objects. | |
| 44 | +| [Data Access from CLR Database Objects](../../relational-databases/clr-integration/data-access/data-access-from-clr-database-objects.md) | Describes how a CLR routine can access data stored in an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. | |
| 45 | +| [CLR Integration Security](../../relational-databases/clr-integration/security/clr-integration-security.md) | Describes the CLR integration security model. | |
| 46 | +| [Debugging CLR Database Objects](../../relational-databases/clr-integration/debugging-clr-database-objects.md) | Describes limitations of and requirements for debugging CLR database objects. | |
| 47 | +| [Deploying CLR Database Objects](../../relational-databases/clr-integration/deploying-clr-database-objects.md) | Describes deploying assemblies to production servers. | |
| 48 | +| [Managing CLR Integration Assemblies](../../relational-databases/clr-integration/assemblies/managing-clr-integration-assemblies.md) | Describes how to create and drop CLR integration assemblies. | |
| 49 | +| [Monitoring and Troubleshooting Managed Database Objects](../../relational-databases/clr-integration/monitoring-and-troubleshooting-managed-database-objects.md) | Provides information about the tools that can be used to monitor and troubleshoot managed database objects and assemblies running in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. | |
| 50 | +| [Usage Scenarios and Examples for Common Language Runtime (CLR) Integration](/previous-versions/sql/sql-server-2016/ms131078(v=sql.130)) | Describes usage scenarios and code samples using CLR objects. | |
| 51 | + |
| 52 | +## See also |
| 53 | + |
| 54 | +- [Assemblies (Database Engine)](../../relational-databases/clr-integration/assemblies-database-engine.md) |
| 55 | +- [Install the .NET Framework SDK](https://dotnet.microsoft.com/download/dotnet-framework) |
0 commit comments