码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2016-09-14 20:35:58      阅读:144      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!