FileLoadException / Msg 10314 Error Running CLR Stored Procedure

久未见 提交于 2019-11-28 05:45:42
homeskillet

Ran the SQL commands below and the issue appears to be resolved.

USE database_name
GO

EXEC sp_changedbowner 'sa'
ALTER DATABASE database_name SET TRUSTWORTHY ON 

Build your project with ANY CPU configuration. I had this problem when compiled my own project with x86 configuration and tried to run it on x64 SQL server.

101V

Applied all of the above suggestion and it failed. Then I recompiled my source code with "Any CPU" option, and it worked!

This link helped: SQL Server failed to load assembly with PERMISSION

Does your assembly do file I/O? If so, you must grant the assembly permission to do this. In SSMS:

  1. Expand "Databases"
  2. Expand the node for your database
  3. Expand "Programmability"
  4. Expand "Assemblies"
  5. Right-click your assembly, choose Properties
  6. On the "General" page, change "Permission set" to "External access"
ALTER AUTHORIZATION ON DATABASE::mydb TO sa;
ALTER DATABASE [myDB] SET TRUSTWORTHY ON
GO
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!