Is it possible to do something like this in sql server 2005?
WITH tmpTable AS (EXEC spWhatever)
Or any other way I can query the data returned from the sp? Thanks!!!
Is it possible to do something like this in sql server 2005?
WITH tmpTable AS (EXEC spWhatever)
Or any other way I can query the data returned from the sp? Thanks!!!
as far as i know you can not. But you can try using User Defined Functions (UDF) instead of SP, if you do that you can you use it like a table.
Temp table:
Or loopback (not sure if this still works). Edit: Could be OPENROWSET as per SQLMenace's answer
only with a loopback query if you don't first want to create the table, see here: Store The Output Of A Stored Procedure In A Table Without Creating A Table
example