I have a stored procedure. In this procedure there's a piece of code that look like
...WHERE someParam IN (1,2)...
I should abstract this part, cause an undefined numer of parameters should be considered (not only 1 OR 2). I get this parameter list from vb.net code as a cvs string (i.e. "1,2" or "78, 109" and so on). Pratically my situation will be something like that:
DECLARE @IdParam varchar(100)
SET @IdParam = '1,2'
...
...WHERE someParam IN (@IdParm)...
but this code will clearly produce me an error:
Conversion failed when converting the varchar value '1,2' to data type int.
What can I do to reach my goal and keep SQL engine quiet? If an optimal solution exist I could consider to modify prexisten VB code.
Edit 1: I wouldn't use that ugly solution of the linked post!