日期:2014-05-17 浏览次数:20537 次
select * from OPENROWSET('MICROSOFT.ACE.OLEDB.12.0','Excel 12.0 Xml;Database=(本地文件路径)','select * from [(文件名,此处后缀名省略)$]')
例:
select * from OPENROWSET('MICROSOFT.ACE.OLEDB.12.0','Excel 12.0 Xml;Database=e:\2013-03-01_Mean.xlsx','select * from [2013-03-01_Mean$]')
Create table TTT(col nvarchar(max))
go
BULK INSERT test_hl..TTT
FROM 'D:\aaa.xlsx'
WITH (
datafiletype='char',
FIELDTERMINATOR = ';',
ROWTERMINATOR = ';'
)
select * from TTT
truncate table TTT