Quantcast
Viewing latest article 4
Browse Latest Browse All 20

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

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 Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.

Viewing latest article 4
Browse Latest Browse All 20

Trending Articles