I have a stored procedure that performs a SELECT of ids (the reason it is inside a procedure is that it at first checks which ids to select).
I would like to use that result set in a procedure query like SELECT * FROM products WHERE productID IN <resultSet>
.
But I do not know how to get the result set of the procedure into a range/interval/...? variable to perform that selection. What am I missing?
Edit: This question is not really a duplicate of SQL server stored procedure return a table, it just has the same solution: Stored Procedures do not return anything.