/* The following script can be used to assist installing the dll. You will need to change the download the DLL and place it somewhere on your SQL Server. Once downloaded, you will need to modify the installation script below to update the installation Path specified as @InstallPath. */ ------------------------------- -- BEGIN INSTALLATION SCRIPT -- ------------------------------- -- set the path, name and hash of the clr dll DECLARE @InstallPath nvarchar(500) = 'C:\Test\OdataLinkCLR\OdataLinkCLR.dll'; DECLARE @InstallName nvarchar(4000) = 'OdataLinkCLR'; DECLARE @hash varbinary(64) = 0x1E1D16630BFE743BEB3046C857A92DC1D25CB0191612A32C34F2AA75852D5E4A0A35CB96A4FF5960932538BBD25E9B21F2A5AEC7011805128F1A3ABF637417CC; --configure advanced options exec dbo.sp_configure 'show advanced options', 1 RECONFIGURE -- enable .net runtime/clr exec sp_configure 'clr enabled', 1 RECONFIGURE -- turn off .net runtime/clr security exec sp_configure 'clr strict security', 0 RECONFIGURE -- turn off advanced options exec sp_configure 'show advanced options', 0 RECONFIGURE -- drop the assembly if it exist -- and add it back in EXEC sp_drop_trusted_assembly @hash = @hash; EXEC sys.sp_add_trusted_assembly @hash = @hash, @description = @InstallName; -- register the dll located at the installation path CREATE ASSEMBLY OdataLinkCLR from @InstallPath WITH PERMISSION_SET = EXTERNAL_ACCESS; GO -- create the function to get odata Create Function GetODataPage(@URL nvarchar(max), @UserName nvarchar(max), @Password nvarchar(max) ) RETURNS nvarchar(max) AS External name OdataLinkCLR.[OdataLinkCLR.OdataLinkCLRFunctions].GetODataPage; GO -- create the function to get odata Create Function GetODataPages(@URL nvarchar(max), @UserName nvarchar(max), @Password nvarchar(max) ) RETURNS nvarchar(max) AS External name OdataLinkCLR.[OdataLinkCLR.OdataLinkCLRFunctions].GetODataPages; GO ----------------------------- -- END INSTALLATION SCRIPT -- -----------------------------