Blog

How to Enable/Disable CLR in SQL Server

Posted by Ravi Shekhar Blogs | SQL Server Sep 06, 2013
We can use this option to prevent any DDL operation.

Today I am going to explain very important feature of sql server 2008. Now we have an option for Enable/Disable of CLR .

We can prevent any DDL(CREATE/DROP) operation in sql server database Just the help of this option.

sp_configure 'clr enabled', 0

GO

RECONFIGURE

GO

Run above code in sql query window.From this query we can disable clr. Now run,

create table test

(

abc varchar(10)

)

drop table test


drop table test

a msg will throw..

"Execution of user code in the .NET Framework is disabled. Enable "clr enabled" configuration option"

Because we have disabled clr option before. Now Run,

sp_configure 'clr enabled', 1

GO

RECONFIGURE

GO

Above query again enable your clr. Now you can perform any DDL operation. 

COMMENT USING
PREMIUM SPONSORS
Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
Employers - Post Free Jobs