94

I am getting the following error on my new installation of ASP.Net and SQL Server when I run my app:

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

I have tried to fix it by running this:

 use dasolPSDev;

 sp_configure 'clr enabled', 1
 go
 RECONFIGURE
 go
 sp_configure 'clr enabled'
 go

But then I get:

 Msg 102, Level 15, State 1, Line 3
 Incorrect syntax near 'sp_config
1

5 Answers 5

143

Try this

use dasolPSDev;

EXEC sp_configure 'clr enabled', 1
 go
 RECONFIGURE
 go
EXEC sp_configure 'clr enabled'
 go
Sign up to request clarification or add additional context in comments.

2 Comments

How long does this script normally take to execute? because mine, I have had it run more than 1 minute and still no result..!!
How to run this
30

Simplified version of jams' solution which worked for me (SQL Server 2012):

sp_configure 'clr enabled', 1
GO
RECONFIGURE
GO

Source: http://msdn.microsoft.com/en-us/library/ms254506%28v=vs.80%29.aspx

Comments

3

I had a similar issue, but this works for me (SQL Server 2008 R2):

sp_configure 'clr enabled', 1
GO

RECONFIGURE
GO

Comments

1

The following steps fixed my problem.

  1. Open SQL Server Management Studio.
  2. Connect to your database instance.
  3. File > New > Query with Current Connection.
  4. Paste the following into the editor (reference: https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/clr-enabled-server-configuration-option?view=sql-server-ver16).
EXEC sp_configure 'clr enabled';  
EXEC sp_configure 'clr enabled' , '1';  
RECONFIGURE;
  1. Click Execute.

Comments

0

I tried with sp_configure @configname=clr_enabled, @configvalue=1

then restarted the sql server. it worked

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.