exec   sp_configure   'show   advanced   options ',   '1 ';   
   go   
   reconfigure;   
   go   
   exec   sp_configure   'clr   enabled ',   '1 '   
   go   
   reconfigure;   
   exec   sp_configure   'show   advanced   options ',   '1 ';   
   go   
打开网页提示:禁止在.net Framework 中执行用户代码。启用‘clr enabled’配置选项。
我查了要执行上面的代码就可以了,但是执行不成功是什么原因??

解决方案 »

  1.   

    消息 15123,级别 16,状态 1,过程 sp_configure,第 51 行
    配置选项 'clr enabled ' 不存在,也可能是高级选项。lz运行的时候是否报这个错误?exec sp_configure 'show advanced options', '1';   
      go   
      reconfigure;   
      go   
      exec sp_configure 'clr enabled', '1'   
      go   
      reconfigure;   
      exec sp_configure 'show advanced options', '1';   
      go   运行这个试试
      

  2.   

     exec sp_configure 'clr enabled ', '1 '   
    后面多了个空格
      

  3.   

    提示比较明显了吧默认情况下 ‘clr enabled’配置选项是关闭的
    用上面的代码就打开了。
      

  4.   

    exec sp_configure 'show advanced options ', '1 ';   
      reconfigure;   
      go   
      exec sp_configure 'clr enabled ', '1 '   
      reconfigure;
      go
      exec sp_configure 'show advanced options ', '1 ';  
      reconfigure; 
      go   
      

  5.   

      exec sp_configure 'show advanced options', '1 ';   
      go   
      reconfigure;   
      go   
      exec sp_configure 'clr enabled', '1 '   
      go   
      reconfigure; 
      go  
      exec sp_configure 'show advanced options', '1 ';   
      go   /*配置选项 'show advanced options' 已从 0 更改为 1。请运行 RECONFIGURE 语句进行安装。
    配置选项 'clr enabled' 已从 1 更改为 1。请运行 RECONFIGURE 语句进行安装。
    配置选项 'show advanced options' 已从 1 更改为 1。请运行 RECONFIGURE 语句进行安装。*/
      

  6.   


    exec sp_configure 'show advanced options', '1'exec sp_configure 'clr enabled', '1'   
      
    reconfigure with OVERRIDE
      

  7.   

    exec sp_configure 'show advanced options', '1 ';   
      go   
      reconfigure;   
      go   
      exec sp_configure 'clr enabled', '1 '   
      go   
      reconfigure; 
      go  
      exec sp_configure 'show advanced options', '1 ';   
      go   
      

  8.   

    exec sp_configure 'show advanced options', '1';
    reconfigure;
    go
    exec sp_configure 'clr enabled', '1';
    reconfigure;
    go
    exec sp_configure 'show advanced options', '1';
    reconfigure; 
    go