当前位置: 代码迷 >> Sql Server >> 关于把Excel资料导入SQL Server 2008
  详细解决方案

关于把Excel资料导入SQL Server 2008

热度:68   发布时间:2016-04-27 10:52:38.0
关于把Excel文件导入SQL Server 2008
--Step 1
EXEC sp_configure 'show advanced options' , 1; 
RECONFIGURE ;
EXEC sp_configure 'Ad Hoc Distributed Queries' , 1; 
RECONFIGURE ;
GO
 
--Step 2
INSERT INTO Post (ID,Txt) SELECT Post_ID,Post_cont FROM OPENROWSET('MICROSOFT.JET.OLEDB.4.0'
,'Excel 8.0;HDR=YES;DATABASE=H:\INFO 341\Assignment 2\EventA.xlsx',sheet2$)

但是报错 Msg 7308, Level 16, State 1, Line 1
OLE DB provider 'MICROSOFT.JET.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.

为什么啊,我的系统是win7 64位 , SQL server 2008



------解决方案--------------------
MICROSOFT.JET.OLEDB.4.0这个是excel 2003的哦,你有没有装?
  相关解决方案