how to use sqlserver2008 to search in files

本文将详细解释如何解决在SQL Server中由于安全配置导致的AdHocDistributedQueries组件被禁用的问题,并提供详细的步骤进行解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

example:
select * from
OPENROWSET('MICROSOFT.JET.OLEDB.4.0'
,'Text;HDR=No;DATABASE=D:\Data\FullIdList'
,'select * from [b.txt]')


problem 1:
SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.
solution :
--0 show sys.configurations, if the value of 'Ad Hoc Distributed Queries' is 0 ,go ahead
SELECT * FROM sys.configurations
ORDER BY name ;
--1. Use below script to enable to update the configurations:
sp_configure 'show advanced options',1
reconfigure
--2.Enable 'Ad Hoc Distributed Queries':
sp_configure 'Ad Hoc Distributed Queries',0
reconfigure


problem 2:
solution :
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\TEXT]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值