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

Adding CLR Stored Procedures to a Database

If you’ve already created and compiled a CLR stored procedure, the next step is to install that CLR procedure in the database. The first step in this process is to copy the .NET assembly to a location that SQL Server can access and then load it into SQL Server by creating an assembly. The syntax for the CREATE ASSEMBLY command is as follows:

CREATE ASSEMBLY AssemblyName [AUTHORIZATION LoginName]FROM  StringPathToAssemblyDll[WITH PERMISSION_SET (SAFE | EXTERNAL_ACCESS | UNSAFE) ]

AssemblyName is the name of the assembly, and StringPathToAssemblyDll is the path to the DLL. The path can be a local path, but often this path is a network share.

The WITH clause is optional, and ...

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