首页 > 代码库 > SQL大圣之路笔记——SQL 获取excel中的数据
SQL大圣之路笔记——SQL 获取excel中的数据
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中的数据
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。