Hi,
We're using Sql Server 2005. We would like to use a stored procedure in a nested SELECT statement, so to speak, but it doesn't work syntax-wise:
This works:
SELECT cKod FROM (SELECT cKod, cDescription FROM MyTable) AS a
But this doesn't:
SELECT cKod FROM (EXEC test_testing) AS a
So, what we're after is to replace the inner SELECT statement with the stored procedure ("test_testing") call, but that code yields the error: "Incorrect syntax near the keyword 'EXEC'." (Of course, test_testing consists of the same SELECT statement as the inner SELECT statement in the first line.)
We would be very grateful for any help!
/Pettrer
We're using Sql Server 2005. We would like to use a stored procedure in a nested SELECT statement, so to speak, but it doesn't work syntax-wise:
This works:
SELECT cKod FROM (SELECT cKod, cDescription FROM MyTable) AS a
But this doesn't:
SELECT cKod FROM (EXEC test_testing) AS a
So, what we're after is to replace the inner SELECT statement with the stored procedure ("test_testing") call, but that code yields the error: "Incorrect syntax near the keyword 'EXEC'." (Of course, test_testing consists of the same SELECT statement as the inner SELECT statement in the first line.)
We would be very grateful for any help!
/Pettrer