SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的问题

信仰诠释过往 2013-12-23 03:42:10
在做一个存储过程。。。在数据库测试的时候抛出如下错误。。
select * from openrowset('sqloledb','ip';'**';'**','exec test.dbo.pc_test')

消息 15281,级别 16,状态 1,第 1 行
SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT 'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。有关启用 'Ad Hoc Distributed Queries' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器"。


然后上网查找解决办。。。 开启'Ad Hoc Distributed Queries' 的时候
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
又抛出错误。。。。

配置选项 'show advanced options' 已从 0 更改为 1。请运行 RECONFIGURE 语句进行安装。
消息 5808,级别 16,状态 1,第 2 行
不支持对系统目录进行即席更新。

然后又查了下资料。。。发现2008不能对系统目录进行更新。。。
求解决办法
...全文
2303 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
KevinLiu 2013-12-23
  • 打赏
  • 举报
回复
一定是可以的,用版主给的代码试试看。
唐诗三百首 2013-12-23
  • 打赏
  • 举报
回复
引用 9 楼 u013254698 的回复:
已设置。。。但还是提示 不支持对系统目录进行即席更新。
请确认一下当前连接的帐号是否具有sysadmin权限.
信仰诠释过往 2013-12-23
  • 打赏
  • 举报
回复
引用 7 楼 ap0405140 的回复:
SSMS-->SQL实例-->右键-->Facets-->Facet-->服务器配置-->AdHocRemoteQueriesEnabled-->设为True
已设置。。。但还是提示 不支持对系统目录进行即席更新。
LongRui888 2013-12-23
  • 打赏
  • 举报
回复
会不会是杀毒软件等的影响呢
唐诗三百首 2013-12-23
  • 打赏
  • 举报
回复
SSMS-->SQL实例-->右键-->Facets-->Facet-->服务器配置-->AdHocRemoteQueriesEnabled-->设为True

信仰诠释过往 2013-12-23
  • 打赏
  • 举报
回复
引用 4 楼 yupeigu 的回复:
我的也是可以的,sql server 2008R2的:

sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;
GO
/*
配置选项 'show advanced options' 已从 1 更改为 1。请运行 RECONFIGURE 语句进行安装。
配置选项 'Ad Hoc Distributed Queries' 已从 0 更改为 1。请运行 RECONFIGURE 语句进行安装。

(1 行受影响) */
SELECT @@version
/*
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64)   Apr 22 2011 19:23:43   Copyright (c) Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) */
Microsoft SQL Server Management Studio 10.0.1600.22 ((SQL_PreRelease).080709-1414 ) Microsoft Analysis Services 客户端工具 2007.0100.1600.022 ((SQL_PreRelease).080709-1414 ) Microsoft 数据访问组件 (MDAC) 6.1.7601.17514 (win7sp1_rtm.101119-1850) Microsoft MSXML 3.0 4.0 5.0 6.0 Microsoft Internet Explorer 8.0.7601.17514 Microsoft .NET Framework 2.0.50727.5472 操作系统 6.1.7601 这是我的sql版本...
小魚人 2013-12-23
  • 打赏
  • 举报
回复
可以吧,我的是也是2008R2
LongRui888 2013-12-23
  • 打赏
  • 举报
回复
我的也是可以的,sql server 2008R2的:

sp_configure 'show advanced options', 1;
RECONFIGURE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;
GO
/*
配置选项 'show advanced options' 已从 1 更改为 1。请运行 RECONFIGURE 语句进行安装。
配置选项 'Ad Hoc Distributed Queries' 已从 0 更改为 1。请运行 RECONFIGURE 语句进行安装。

(1 行受影响) */
SELECT @@version
/*
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64)   Apr 22 2011 19:23:43   Copyright (c) Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) */
發糞塗牆 2013-12-23
  • 打赏
  • 举报
回复
我用08R2的一样可以
sp_configure 'show advanced options', 1;
  RECONFIGURE;
  GO
  sp_configure 'Ad Hoc Distributed Queries', 1;
  RECONFIGURE;
  GO
  /*
Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.
Configuration option 'Ad Hoc Distributed Queries' changed from 0 to 1. Run the RECONFIGURE statement to install.
  */
  SELECT @@version
  /*
  Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64)   Apr  2 2010 15:48:46   Copyright (c) Microsoft Corporation  Standard Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor) 
  */
信仰诠释过往 2013-12-23
  • 打赏
  • 举报
回复
难道是我的sql有问题?
發糞塗牆 2013-12-23
  • 打赏
  • 举报
回复
不会不支持啊
sp_configure 'show advanced options', 1;
  RECONFIGURE;
  GO
  sp_configure 'Ad Hoc Distributed Queries', 1;
  RECONFIGURE;
  GO
  /*
  Configuration option 'show advanced options' changed from 1 to 1. Run the RECONFIGURE statement to install.
Configuration option 'Ad Hoc Distributed Queries' changed from 0 to 1. Run the RECONFIGURE statement to install.

  */
  SELECT @@version
  /*
  Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64) 
	Dec 28 2012 20:23:12 
	Copyright (c) Microsoft Corporation
	Enterprise Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: )

  */

34,829

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧