打开较大存储量的.sql文件时,出现SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问
1.
“消息 15281,级别 16,状态 1,过程 xp_cmdshell,第 1 行
SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'xp_cmdshell'。有关启用 'xp_cmdshell' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器". ”
解决方法:
sqlserver2005时
EXEC sp_configure N'show advanced options', N'1'
RECONFIGURE WITH OVERRIDE
EXEC sp_configure N'xp_cmdshell', N'1'
RECONFIGURE WITH OVERRIDE
EXEC sp_configure N'show advanced options', N'0'
RECONFIGURE WITH OVERRIDE
如果不是sqlserver2005可使用如下的方法(我没有实验)
EXEC sp_configure 'show advanced options', 1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell', 1;RECONFIGURE
RECONFIGURE:指定如果配置设置不需要服务器停止并重新启动,则更新当前运行的值,如果没有这个关键字的话将要重新启动sqlserver服务才能生效。
Remind:开启执行顺序是'show advanced options',然后才执行'xp_cmdshell'。,如果要关闭这个高级选项的话,要先执行'xp_cmdshell'然后再执行'show advanced options'。数字1代表开启,0代表关闭。
如果cmdshell还不行的话,就再运行:
dbcc addextendedproc("xp_cmdshell","xplog70.dll");--
或者
sp_addextendedproc xp_cmdshell,@dllname='xplog70.dll'
来恢复cmdshell。
2.
执行 master.dbo.xp_cmdshell 'osql -U sa -P 123456 -i d:\test.sql'
打开较大存储量的.sql文件时,出现SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问的更多相关文章
- sqlserver -- 学习笔记(二)“SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问”解决方法
将数据表导出到excel时出现下面错误: SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问,因为此组件已作为此服务器安全配置的一部分而 ...
- [ERROR]pyodbc.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]SQL Server 阻止了对组件“xp_cmdshell”的 过程“sys.xp_cmdshell”的访问
环境: Windows 2012 R2 SQL Server 2014 通过MSSQL查询数据库服务器时间,报错如下: pyodbc.ProgrammingError: (', '[42000] [M ...
- SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问
sql server 2005: EXEC sp_configure N'show advanced options', N'1' RECONFIGURE WITH OVERRIDEEXEC sp_c ...
- SQL Server 阻止了对组件“xp_cmdshell”的 过程“sys.xp_cmdshell”的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。
今天在创建数据库的时候突然发现,xp_cmdshell的存储过程不能用了,网上一搜,发现大部分都是只关闭安全配置,然后就有了下文 代码:具体的看注释,值得一提的是==>reconfigure w ...
- SQL Server阻止了对组件xp_cmdshell过程的解决方案
使用SQL tools连接sqlserver时候出现以下问题: SQL Server阻止了对组件xp_cmdshell过程的解决方案错误描述:SQL Server阻止了对组件‘xp_cmdshell’ ...
- SQL Server阻止了对组件xp_cmdshell过程的解决方案 分类: SQL Server 2015-03-05 08:31 305人阅读 评论(0) 收藏
SQL Server阻止了对组件xp_cmdshell过程的解决方案 错误描述:SQL Server阻止了对组件'xp_cmdshell'的过程'sys.xp_cmdshell'的访问.因为此组件已作 ...
- mysql数据库导入sql文件时提示“Error Code: 1153 - Got a packet bigger than 'max_allowed_packet' bytes”解决办法
向mysql数据库中导入sql文件时,如果文件过大(几百M),会提示"Error Code: 1153 - Got a packet bigger than 'max_allowed_pac ...
- source命令 导入.sql文件时,中文乱码 或者是注释乱码
1.source命令 导入.sql文件时,中文乱码 或者是注释乱码 首先进入dos命令,进入mysql数据库,之后use 数据库:之后查看你的mysql数据库编码 如下命令:模糊查询变量charact ...
- 解决“SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT 'OpenRowset/OpenDatasource' 的访问……”【转】
SQL Server 阻止了对组件 /'Ad Hoc Distributed Queries/' 的访问 在Sql Server中查询一下Excel文件的时候出现问题: SELECT * FROM ...
随机推荐
- javascript 关于一周前一个月前的处理方法
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 快速入门cocos2d-x jsbinding
如果你是一个cocos2d-x的老手,那你可以忽略这篇博文,如果你是一个接触过javascript,想通过HTML5做游戏的,但是苦于不知道如何下手,那么这篇博文可能会帮到你. cocos2dx-js ...
- bat判断某个目录是否存在
使用批处理判断某个目录是否存在的语句. if not exist xxx_folder_name md xxx_folder_name
- thrift的简单实现
1.使用windows实现,首先在apache官网下载一个thrift的编译工具,在项目中建一个文件叫add.thrift的文件,内容如下: namespace java com.vipshop.sa ...
- the smallest positive number
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any rema ...
- BZOJ1119: [POI2009]SLO
1119: [POI2009]SLO Time Limit: 30 Sec Memory Limit: 162 MBSubmit: 379 Solved: 181[Submit][Status] ...
- 【转】你应该知道的 10 个 VirtualBox 技巧与高级特性
原文网址:http://www.oschina.net/translate/10-virtualbox-tricks-and-advanced-features-you-should-know-abo ...
- bzoj1965 [Ahoi2005]SHUFFLE 洗牌
Description 为了表彰小联为Samuel星球的探险所做出的贡献,小联被邀请参加Samuel星球近距离载人探险活动. 由于Samuel星球相当遥远,科学家们要在飞船中度过相当长的一段时间,小联 ...
- [LeetCode] Maximum Gap 解题思路
Given an unsorted array, find the maximum difference between the successive elements in its sorted f ...
- html基础知识总结2
下拉列表,文本域,复选框 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...