CLR works with Trustworthy OFF and no Asymmetric key

  • We have a curious situation on a SQL 2014 DB, with Trustworthy set to OFF. There is a job that runs a data export to a file via a CLR. The assembly as PERMISSION_SET = EXTERNAL_ACCESS, however there is no Asymmetric key for the assembly. Therefore what I trying to work out is why this is NOT failing. Some further information on this specific database that may or may not be relevant is:

    1. It was upgraded a few weeks ago (Backup/Restore) from a SQL 2012 - SQL 2014 server

    2. It as a Compatibility Level = 110 (2012)

    3. The Previous 2012 database DID have Trustworthy ON

    4. The CLR are actually being run against a snapshot of the database (Actually I think this one is a red herring. The SP is getting data from a table in the snapshot, but the CLR used it the one from the main DB)

  • Does SQL Server verify assemblies at the time they're loaded into the DB, or on every execution? In the former case, your CLR code would continue to run because trustworthy database was enabled at the time the assembly was loaded.

  • I've hit the error on both trying to install the assembly and running the CLR once the assembly is loaded and I've switched the Trustworthy property OFF. I've also tried replicating the problem but haven't been able to do so.

    i.e. I created a new 2012 DB with Trustworthy ON and a CLR installed. Then did a backup/Restore to a 2014 server. The Trustworthy property is set to OFF and as expected the CLR would not work

Viewing 3 posts - 1 through 2 (of 2 total)

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