zoukankan      html  css  js  c++  java
  • 禁止在 .NET Framework 中执行用户代码。启用 "clr enabled" 配置选项

    一  解决方案

    第一步.打开SQLServer执行:

    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

    第二步:执行

    ALTER DATABASE DocHalo_LOCAL SET TRUSTWORTHY on  

    第三步:执行

    exec sp_changedbowner 'sa'

    二 简要解释

    1. 使用sp_configure可以显示或更改服务器级别的设置。若要更改数据库级别设置,请使用 ALTER DATABASE。若要更改仅影响当前用户会话的设置,请使用 SET 语句。
    更新运行的配置值

    sp_configure [ [ @configname = ] 'option_name' 
          [ , [ @configvalue = ] 'value' ] ]
    2.为option指定新的值的格式为如上,可以参照最上面的写法。其中clr enabled 选项提供下列值。

    值 说明 
    0
     不允许在 SQL Server 上执行程序集。
    1
     允许在 SQL Server 上执行程序集。

    3.clr enabled 选项是一个高级选项。如果使用 sp_configure 系统存储过程来更改该设置,则只有在 show advanced options 设置为 1 时才能更改 clr enabled。该设置在运行 sp_configure 后立即生效。不需要重新启动 SQL Server 实例。
    注意: 
    运行 RECONFIGURE 时,clr enabled 选项的运行值将从 1 改为 0,所有包含用户程序集的应用程序域将立即被卸载

    4.后面两个步骤必须执行

  • 相关阅读:
    Counting Stars hdu
    Color it hdu
    steins;Gate
    原根
    3-idiots
    Tree
    洛谷P1352 没有上司的舞会
    洛谷P1131 时态同步
    洛谷P3177 树上染色
    Codeforces Round #617 (Div. 3)
  • 原文地址:https://www.cnblogs.com/CugYzc/p/9371589.html
Copyright © 2011-2022 走看看