Prerequisites to enable before you can deploy a CLR function

Posted: February 5th, 2011
Author: Anthony Kippen | Filed under: Code, SQL | Tags: , , , , | Comments Off
  1. Enable the CLR execution on the target database that is disabled by default. The T-SQL command to enable CLR execution is as follows:
    sp_configure ‘clr enabled’, 1
    reconfigure
    GO
  2. Make the database TRUSTWORTHY. This is required because our CLR project is going to be deployed with permission set = EXTERNAL_ACCESS as its calling an external web service, and for an assembly having EXTERNAL_ACCESS permissions we need to make database TRUSTWORTHY. The command for making database TRUSTWORTHY is
    ALTER DATABASE <databasename> SET TRUSTWORTHY ON
    GO