enable clr on database level

  • Is there a way to enable clr on database level instead of the code below or a a gui to do that.

    sp_configure 'clr enabled', 1

    GO

    RECONFIGURE

    GO

  • No, that's how you enable CLR.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • As mentioned you have to enable the CLR at the instance-level but you can enable it on the instance and add a DDL trigger FOR the DDL_ASSEMBLY_EVENTS event group in all databases where you want to prevent the creation of assemblies.

    Something simple like this could do the trick:

    CREATE TRIGGER [db_no_assembly] ON DATABASE

    FOR DDL_ASSEMBLY_EVENTS

    AS

    BEGIN

    RAISERROR('No CLR DDL activities allowed in this database.',11,1);

    ROLLBACK;

    END

    GO

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

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

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