O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Developing Managed Objects with Visual Studio 2012

When SQL Server 2012 is installed, it includes Microsoft.SqlServer.Server, the assembly that contains the attributes and other classes needed for SQLCLR (the common acronym for managed code running in SQL Server) programming.

The first step in working with SQLCLR is to enable this feature in SQL Server.

Setting Up the Server for Managed Code Execution

Before you can work with managed database objects, you need to execute the following T-SQL commands in the context of the master database:

sp_configure 'clr enabled', 1RECONFIGUREgo

This step is necessary because SQL Server comes with managed code execution turned off by default.

At this point, you’re ready to create your first SQLCLR project ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required