从sql2005导入Excel文件
--没有开启设置导致的
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE
GO
SELECT * FROM
opendatasource('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=D:\my document\tmp\11.xls')...[Sheet11]
select * from OpenRowSet('Microsoft.Jet.OLEDB.4.0'
,'Excel 8.0;HDR=Yes;IMEX=1;Database=基本信息-20091123.xls',
'select * from [Sheet1$]')