0

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?

1 Answer 1

1

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'
Sign up to request clarification or add additional context in comments.

1 Comment

Why is 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.