Is it possible to call a stored procedure within a IN clause?
Select field0, field2 FROM Table
WHERE field0 in (exec storedproc)
The reason for stored procedure is because of the complexity of it
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could have to use OpenRowset to achieve this.
In order to do this the following options must be enabled on the server:
If it isn’t possible to change these settings then another option, as discussed with Martin in the comments, is to populate a temporary table.
e.g.
To insert the results of the stored procedure to a temporary table the definition of the temporary table must match the results of the stored procedure exactly.