I have a CheckBoxList where users can select multiple items from the list. I then need to be able to pass these values to my Stored Procedure so they can be used in a WHERE
alter procedure c2
(@i varchar(5))
as
begin
declare @sq nvarchar(4000)
set @sq= 'select * from test where id in () '
SET @sq= REPLACE(@sq, '', @i)
EXECUTE sp_executesql @sq
end
exec c2 '1,3'