从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$]')

posted @ 2009-11-24 15:35  db's jim  阅读(186)  评论(0编辑  收藏  举报