If we need to query a table based on some set of values for a given column, we can simply use the IN clause.
But if query need to be performed based on multiple col
Determine whether the list of names is different with each query or reused. If it is reused, it belongs to the database.
Even if it is unique with each query, it may be useful to load it to a temporary table (#table syntax) for performance reasons - in that case you will be able to avoid recompilation of a complex query.
If the maximum number of names is fixed, you should use a parametrized query.
However, if none of the above cases applies, I would go with inlining the names in the query as in your approach #1.