直接在查詢分析器里面使用下列代碼:
SELECT * FROM OPENDATASOURCE( 'Microsoft.Jet.OLEDB.4.0', 'Data Source=c:\a.xls;User ID=
assword=;Extended properties=Excel 8.0')...[a$]
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=c:\a.xls','SELECT * FROM [a$]')
SELECT * FROM OPENDATASOURCE( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\ ";User ID=Admin
assword=;Extended properties=dBase 5.0')...a
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'dBase 5.0;Database=c:\','SELECT * FROM [a]')
就可實現(xiàn)對外部EXCEL,dbf等文件的查詢