1 Select 2 --Case (IsNumeric (CMF_NO)) while 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)) while 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( -,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( -,0), Channel_gid_num)Else Convert(nvarchar(255), Channel_gid_num)End asChannel_gid_num,9 channel_name,channel_addressTen One from OpenDataSource('microsoft.ace.oledb.12.0','Data Source=c:\inetpub\wwwroot\datasynchronization\downdata\2016914164711677.xls; Extended Properties=excel 12.0')...[sheet1$];
SQL Sage Road Note--sql get data in Excel