Have you ever wished T-SQL allowed you to pass an array into a stored procedure? Well the spListToTable stored procedure listed below accepts a delimeted string and turns it into a table.
Code your stored procedure to accept a varchar, create a temporary table, call spListToTable, and use the populated temporary table as if it were an array of values.