我已经创建了下面的存储过程:如何在存储过程中将多个字符作为变量传递?
ALTER PROCEDURE [dbo].[CountInJunction]
@Mod as nvarchar(10),
@Junction as nvarchar(10),
@PJ as nvarchar(10),
**@case as varchar(10)**,
@Date as varchar(20)
as
begin
declare @result as int
select @result = count(distinct CONCAT ([UCID],[CALLSEGMENT]))
from IVR_LINES
where MODULE = @Mod and DATE = @date
and EVENT_NAME = @Junction and **EVENT_VALUE in (@case)**
insert into [dbo].[MainJuncTable] values(@Mod,@PJ,@Junction,@case,@result,null,null,@date)
return @result
end
我想通过( '0', '5'),为@case。
由于某种原因,我得到0作为结果,这是不正确的。它似乎是SP不能正确解释('0','5')。 我一直试图多个组合如:
'0', '5'
'0' + ' '+ 5''
'0,5'
等等。
没有用。
有没有什么方法可以正确传递这些字符?
谢谢。
看到这个漂亮的[由厄兰Sommarskog文章(HTTP://www.sommarskog .SE /阵列合sql.html) – Andomar