SQL code select * into temp_install_table from OpenRowSet('microsoft.jet.oledb.4.0','Excel 5.0;HDR=yes;database=F:\install.xls;', 'select * from [install$]')
测试 在Excel中插入如下数据:f是日期型 a b c d e f g NULL 200601001 16.00 中国工商银行 1899-12-30 00:00:00.000 河北省 沧州市 ---- SELECT * into # FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\aa.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[Sheet1$]
select * from #
drop table # ---- select * from OpenRowSet('microsoft.jet.oledb.4.0','Excel 5.0;HDR=yes;database=c:\aa.xls;', 'select * from [Sheet1$]')
SELECT * into # FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\aa.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[Sheet1$]
select * from #
drop table #
/* a b c d e f g h ------------------- -------------------------------------- ----------------------------------------------------- -------------------------------------------------------- ------------------------------------- ---------------------------- ------------------------------------------ NULL 200601001.0 16.0 中国工商银行 1899-12-30 00:00:00.000 河北省 沧州市