How to Compile, Deploy and Consume a SQL Server CLR Assembly

  • shesh.singh

    Valued Member

    Points: 60

    greg.rowan (8/14/2013)


    I followed this article step by step, but when I go to execute the Functions, I get the following error:

    An error occurred in the Microsoft .NET Framework while trying to load assembly id 65579. 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. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

    I tried dropping Assembly and re-adding as UNSAFE, but I get the same error. Any ideas what I may be doing wrong?

    p.s. running on Sql Svr 2012 instance

    I had same problem and compiling with Any CPU option solved the issue.

  • greg.rowan

    Valued Member

    Points: 59

    AnyCPU fixed my issue. Thanks for the assist.

  • Andy Warren

    SSC Guru

    Points: 119676

    Using encryption alone doesn't solve the credit card problem. The auditor should be asking about split knowledge/dual control of the key - I think its in section 3.6 of the PCI standard. It depends on the auditor, but many will not sign off on the technique you're using for key management. PCI also requires an annual key change, tracking of retired and destroyed keys, etc, etc. Better to encrypt than not, but just doing encryption won't guarantee PCI compliance and it won't guarantee that your data can't be compromised if someone gets access to the database.

  • Stan Kulp-439977

    SSCrazy Eights

    Points: 9946

    I wasn't really recommending this as a rock-solid security solution. I just wanted a non-trivial application for a CLR assembly that would be easy to understand. It took me a long time to figure out how to use CLR assemblies. I wish someone had written this article for me a couple of years ago.

  • Andy Warren

    SSC Guru

    Points: 119676

    Stan, kudos for both figuring it out on your own and filling a void on the how-to side, that's the best part of the SQL Server community. I also get the example, I just worry that someone searching for "SQL credit card encryption" find it and thinks, wow, I'm done, rather than closer to done. Hope you'll write more articles.

Viewing 5 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply