kat writes "Is there a way to pass a comma separated list to a stored proc for use in select statement using the 'IN' search condition? I have tried passing a CSV of integer values(which where converted and passed as a varchar) to a stored proc and using the variable, but this was to no avail. Here is a loose example of what I tried:Here is the proc: create proc exampleSP( @passedList varchar(1000) ) as begin select someRecords from someTable where someIntField IN (SELECT @passedList) end
And with the proc here is a query that was executed: declare @numList varchar(1000) select @numList = '5401, 5402, 5403, 5404' execute("exampleSP @passedList=" + @numList)For the sake of this example, assume that 'someIntField' in 'someTable' contains integer values from 1 to 8000 and just use your imagination for the 'someRecords' field...I am using SQL Server 7.0, SP3. Thanks in advance for any help!-KAT"