日期:2014-05-18 浏览次数:20487 次
SELECT '列1','列2' UNION SELECT cInWareid,CAST(iChCon AS VARCHAR(50)) FROM inware UNION SELECT '列3','列4' UNION SELECT cInWareNo,CONVERT(varchar(50),dInWareDate,111) FROM inware
、在SQL SERVER里查询Excel数据: -- ====================================================== SELECT * FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\book1.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[Sheet1$] 下面是个查询的示例,它通过用于 Jet 的 OLE DB 提供程序查询 Excel 电子表格。 SELECT * FROM OpenDataSource ( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\Finance\account.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...xactions ------------------------------------------------------------- 2、将Excel的数据导入SQL server : -- ====================================================== SELECT * into newtable FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\book1.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[Sheet1$] 实例: SELECT * into newtable FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\Finance\account.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...xactions -------------------------------------------------------------