(1)創建Excel文件c:\temp.xls
(2)執行查詢
insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 5.0;HDR=YES;DATABASE=c:\temp.xls',sheet1$)
select * from tablename
同樣在SQL Server中查詢Excel的記錄
select * from OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 5.0;HDR=YES;DATABASE=c:\temp.xls',sheet1$)