excel loading
USE [master]
GO
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'AllowInProcess' , 1
GO
EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0' , N'DynamicParameters' , 1
GO
use [a2d_test_login_server_01]
go
exec sp_configure 'show advanced options', 1
reconfigure with override
go
exec sp_configure 'Ad Hoc Distributed Queries', 1
reconfigure with override
go
exec sp_configure 'Ad Hoc Distributed Queries'
go
--파일닫고
select identity(int, 1,1) idx, * into result
from OPENROWSET(
'Microsoft.ACE.OLEDB.12.0'
, 'Excel 12.0; HDR=YES; IMEX=1; Database=C:\a2d\result\output_login_server2.xlsx'
, 'SELECT * FROM [aaa$a1:w]')
-- 파일이 열려 있을 때
메시지 7399, 수준 16, 상태 1, 줄 27
연결된 서버 "(null)"의 OLE DB 공급자 "Microsoft.ACE.OLEDB.12.0"에 오류가 발생했습니다. 공급자에서 오류에 관한 정보를 주지 않았습니다.
메시지 7303, 수준 16, 상태 1, 줄 27
연결된 서버 "(null)"에 대한 OLE DB 공급자 "Microsoft.ACE.OLEDB.12.0"의 데이터 원본 개체를 초기화할 수 없습니다.