how to use sqlserver2008 to search in files
2017-07-13 11:03
537 查看
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]
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]
相关文章推荐
- How to use logrotate to manage log files in Linux
- Know How To Use ID_NULL Function To Search An Object In Oracle Forms
- Netezza External Tables --How to use local files in external table
- How to Use Rsync to Sync New or Changed/Modified Files in Linux
- How to use Metadata as search parameter in Advance Search Web Part
- [转]How to Use xp_dirtree to List All Files in a Folder
- how to use deb files in ubuntu
- How to use logrotate to manage log files in linux(如何在Linux中使用logrotate去管理日志文件)
- 如何在python中使用*args,**kwargs (How to use *args and **kwargs in Python)
- How to use libcurl in C++ with std::string
- How to use the new CSS syntax in Flex 4
- 将RadGridView 在RadcomboBox里的应用(How to use RadGridView in RadcomboBox)
- IIS->Error Pages:How to Use Detailed Errors in IIS 7.0
- How to use virt-install in OpenSolaris
- How to Delete HUGE (100-200GB) Files in Linux
- How to leave the open file in eclipse tab after search?
- How to use ActiveRecord in a ruby script outside Rails?
- How To Use XDOLoader to Manage, Download and Upload Files? (文档 ID 469585.1)
- How to unload a kernel module in use
- QTP的那些事 -– Visual Relation Identifier Feature: How to use in the real world