Quantcast
Channel: SQL Server 2005 – SQL Steve
Viewing all articles
Browse latest Browse all 17

How to: Enable CLR (Common Language Runtime) in SQL Server

$
0
0

With the release of SQL Server 2005 it became possible for developers to write C# or VB.NET code that can execute within SQL Server.  One thing that is often times overlooked when installing a .NET assembly into a SQL Server database is enabling the database to execute CLR code.  In order to do this, simply execute the following code:

use master
GO
 
exec sp_configure ‘show advanced options’ , ‘1’
GO
 
RECONFIGURE WITH OVERRIDE
GO
 
exec sp_configure ‘clr enabled’ , ‘1’
GO
 
RECONFIGURE WITH OVERRIDE
GO

That’s it.  Short and sweet.  Once this code executes, all assemblies installed within the database are available for use.

That’s it for today.  Please check back tomorrow for more Tips & Tricks.


Filed under: .NET, C#, SQL Server, SQL Server 2005, SQL Server 2008, SQL Server CLR, SQL Server Programming Tagged: C#, CLR, Common Language Runtime, SQL Server, VB.NET

Viewing all articles
Browse latest Browse all 17

Trending Articles