I'm receiving an error when trying to run a CLR object from SQL Server:
An error occurred in the Microsoft .NET Framework while trying to load assembly id 65538...
Do I need to enable some SQL Server setting, or is it a bug?
First, you need to enable CLR execution by running this:
EXEC sp_configure 'clr enabled';
EXEC sp_configure 'clr enabled' , '1';
RECONFIGURE;
then change the owner by running this:
USE master
GO
ALTER DATABASE [database_name] SET TRUSTWORTHY ON
USE [database_name]
GO
EXEC sp_changedbowner 'sa'
TRUSTWORTHY and sa database ownership required in your case? Neither shouldn't typically be needed, even with unsafe assemblies. Module signing is a better practice.