2017-05-25 40 views
0

我正在使用SQL Server 2014,並且每週都必須執行一個大的選擇查詢並將這些結果複製到Excel 2013中。但是在複製時,額外空間正在插入一列,所以我不能確切的格式到Excel。將記錄從SQL Server 2014複製到Excel時需要額外的空間

屏幕截圖:

enter image description here

enter image description here

這是分裂的查詢:

Select top 1 
    substring (text, charindex('sets: ', text) + 6, 40) 
from 
    di_log 
where 
    infonum = 6 
    and text like 'Finished reading%Sx33%' 

union all 

select top 1 
    substring (text, charindex('sets: ', text) + 6, 40) 
from 
    di_log 
where 
    infonum = 6 
    and text like 'Finished reading%Sx33%' 

當我執行的SQL Server 2012上,我沒有任何問題。

+0

任何人都可以幫助這個 – Prasanth

回答