You do not specify which database it is, but for SQL Server there is a way of doing this - but it isn't "pretty", so I would much rather advice you to rework the method.
However, basically - you need to execute the a string so you can parse in a comma separated string.
Something along this line:
And then call the sproc with an input string which looks something like:Code:CREATE PROCEDURE P1 ( @par1 varchar(max) ) as begin exec('select * from table1 where column1 in (' + @par1 + ')') end
But it isn't a "pretty" way of doing this, and I wouldn't really recommend doing it.Code:EXEC P1 '''value1'',''value2'''




Reply With Quote