Hi here is the below stored procedure and when i pass the single value to the @getValue parameter it is not giving any error but when i select multiple values it is resulting the error as it is showing in the title
ALTER PROCEDURE [dbo].[spGetValues](
@getValue int = 100
,@userId varchar(200) = null
)
AS
declare @runTime as datetime = getutcdate()
declare @rowCnt as int
select
csk
, ccode
, cdesc
from
dbo.code
where
ctype = 'status_csk'
and csortnum >= case @getValue
when 100 then 0
when 101 then 10000
when 102 then 100000
end
and csortnum < case @getValue
when 100 then 10000
when 101 then 100000
when 102 then 200000
end
order by
csortnum
--=======================================================
--=======================================================
set @rowCnt = @@ROWCOUNT
insert into dbo.report
(
rname
, rincrement
, rdate
, ruserid
, rurl
, rsecs
, rscnt
, rparm1
, rparm2
)
values
(
OBJECT_NAME(@@PROCID)
, 0
, GETUTCDATE()
, SUSER_NAME()
, null
, DATEDIFF(S,@runTime ,GETUTCDATE())
, @rowCnt
, 'RptUser:' + isnull(@userId , '')
, 'TcType: ' + cast(@getValue as varchar(6))
)
so if anyone knows what's the problem please let me know.