89

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
cdub
  • 24,555
  • 57
  • 174
  • 303
  • 1
    From Microsoft: https://support.microsoft.com/en-us/help/2120850/error-message-after-you-restore-a-sql-server-2008-32-bit-dynamics-pos – Darren Griffith Nov 21 '19 at 21:11

4 Answers4

137

Try this

use dasolPSDev;

EXEC sp_configure 'clr enabled', 1
 go
 RECONFIGURE
 go
EXEC sp_configure 'clr enabled'
 go
Amit
  • 21,570
  • 27
  • 74
  • 94
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

Jon Schneider
  • 25,758
  • 23
  • 142
  • 170
3

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

sp_configure 'clr enabled', 1
GO

RECONFIGURE
GO
hong4rc
  • 3,999
  • 4
  • 21
  • 40
0

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

then restarted the sql server. it worked