We've written a couple of routines in .NET to help with this situation in SQL for our medical appliation. We sometimes need to pass over a dynamically sized list of PKs for use within a SQL sproc. To do that we first convert the list into a binary stream within .NET and pass that stream to the SQL sproc as a VarBinary(MAX) paramater. Once in the sproc, we have a a custom CLR udf that turns the binary stream into a single-column table containing all of the PKs from the list. So, within the sproc, you just join in the results of the UDF to a select statement to limit the results down to the contents of the list:
SELECT
CST.*
FROM Customers AS CST
INNER JOIN dbo.Udf_BytesToPkList(@CustomerPKs) AS CPK ON CST.cst_pk = CPK.pk
Does that sound like something that would handle your need here? The custom UDF is really the only part of the process that has any complexity at all, and I can go into greater detail there if it sounds like something that can help you out .