首页 > 数据库技术 > 详细

SQL大圣之路笔记——SQL 获取excel中的数据

时间:2016-09-14 20:34:07      阅读:190      评论:0      收藏:0      [点我收藏+]
 1  select 
 2   --case (isnumeric(CMF_No)) when 1 then Convert(decimal(18,0),CMF_No) 
 3   --else Convert(nvarchar(255),CMF_No) end as CMF_No,Disti_Name,
 4   --case (isnumeric(Disti_Invoice_Num)) when 1 then Convert(decimal(18,0),Disti_Invoice_Num) else ‘sss‘ end as Disti_Invoice_Num,
 5   case  when len(Disti_Invoice_Num)<=1 then null when isnumeric(Disti_Invoice_Num) = 1 then Convert(decimal(18,0),Disti_Invoice_Num) else Convert(nvarchar(255),Disti_Invoice_Num)
 6   end as Disti_Invoice_Num,
 7   Disti_Invoice_Date,Scan_Date,Bar_Code,Product_Code,
 8   case (isnumeric(Channel_GID_Num)) when 1 then Convert(decimal(18,0),Channel_GID_Num) else Convert(nvarchar(255),Channel_GID_Num) end as Channel_GID_Num,
 9   Channel_Name,Channel_Address 
10   
11   from OpenDataSource (Microsoft.ACE.OLEDB.12.0,Data Source=C:\Inetpub\wwwroot\DataSynchronization\DownData\2016914164711677.xls;Extended properties=Excel 12.0)...[Sheet1$];

 

SQL大圣之路笔记——SQL 获取excel中的数据

原文:http://www.cnblogs.com/allenzhang/p/5873292.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!