April 16, 2012 at 6:54 am
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
April 16, 2012 at 7:08 am
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
April 16, 2012 at 12:57 pm
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