Ok, I did a backup of a db, that contained CLR procs, and then restored it with another name; set the database trust:
ALTER DATABASE [MyDb] SET TRUSTWORTHY ON;
...executed a CLR proc and here is what SQL gave me:
Msg 10314, Level 16, State 11, Line 1
An error occurred in the Microsoft .NET Framework while trying to load assembly id 66426. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error:
System.IO.FileLoadException: Could not load file or assembly 'ciqapplication, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Exception from HRESULT: 0x80FC80F1
System.IO.FileLoadException:
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
Thankfully it was an easy one to fix (see MSKB: http://support.microsoft.com/kb/918040)
I changed the db owner to sa:
USE [MyDb];
GO
EXEC sp_changedbowner 'sa';
...and it now works. Turns out that there is an issue the db owner not having a specific login on the server, even though my access was granted via a group login.
Sure, you could have figured this out with google but it did seem a nice nugget to blog about.
Wow! Wow! Wow! THANK YOU!
2 years ago
No comments:
Post a Comment