0
我已經編寫了一個存儲過程並且具有一個varchar(200)varibale作爲返回變量,但在輸出中其顯示爲「將varchar值轉換爲整數時轉換失敗」程序即時沒有轉換爲int,但即時通訊面對錯誤存儲過程的返回值中的錯誤
alter proc rulename @mfid varchar(20)
as
declare @ACF2 varchar(200)
begin
if((select count(distinct(Rulename)) as count1 from MainframeExtractsPLP where [email protected]) > 0)
begin
set @ACF2='Apollo'
end
if((select count(distinct(Rulename)) as count1 from MainframeExtractsPLP where [email protected]) > 0)
begin
set @ACF2= @ACF2 + 'GP'
end
if((select count(distinct(Rulename)) as count1 from MainframeExtractsPLP where [email protected]) > 0)
begin
set @ACF2= @ACF2 + ',' + 'Tactical Comp'
end
if((select count(distinct(Rulename)) as count1 from MainframeExtractsPLP where [email protected]) > 0)
begin
set @ACF2= @ACF2 + ',' + 'Unit Valuation'
end
if((select count(distinct(Rulename)) as count1 from MainframeExtractsPLP where [email protected]) > 0)
begin
set @ACF2= @ACF2 + ',' + 'NPVS'
end
if((select count(distinct(Rulename)) as count1 from MainframeExtractsPLP where [email protected]) > 0)
begin
set @ACF2= @ACF2 + ',' + 'Apollo Test'
end
if((select count(distinct(Rulename)) as count1 from MainframeExtractsPLP where [email protected]) > 0)
begin
set @ACF2= @ACF2 + ',' + 'GP Test'
end
if((select count(distinct(Rulename)) as count1 from MainframeExtractsPLP where [email protected]) > 0)
begin
set @ACF2= @ACF2 + ',' + 'Tactical Comp Test'
end
if((select count(distinct(Rulename)) as count1 from MainframeExtractsPLP where [email protected]) > 0)
begin
set @ACF2= @ACF2 + ',' + 'Unit Valuation Test'
end
if((select count(distinct(Rulename)) as count1 from MainframeExtractsPLP where [email protected]) > 0)
begin
set @ACF2= @ACF2 + ',' + 'NPVS Test'
end
return @ACF2
end