If you want to add a reference to the System.Xml.Linq.dll in a SQLServerProject VS2008 or any other external assembly just create a normal class library add all you’re references and deploy the created assembly:

CREATE ASSEMBLY [Rvl.Prototype.CommonClassLibrary.dll]
FROM 'C:\Temp\Rvl.Prototype.CommonClassLibrary.dll'
WITH PERMISSION_SET = UNSAFE
GO

image

After deploying the normal assembly you can reference that assembly in you’re SqlServerPorject by clicking “Add reference” > SQL Server

image

Using the “UNSAFE” permmission set might result in errors make sure you’re SQL Server instance has clr enabled:

sp_configure 'clr enabled', 1;
GO

RECONFIGURE;
GO

And you’re database property TRUSTWORTHY is ON:

ALTER DATABASE Mydatabase SET TRUSTWORTHY ON;
GO

The user executing the stored procedure must be sysadmin or you must set correct prermissions, see google.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.