--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的哦,你有没有装?