How to SELECT FROM stored procedure

You can

  1. create a table variable to hold the
    result set from the stored proc and
    then
  2. insert the output of the
    stored proc into the table variable,
    and then
  3. use the table variable
    exactly as you would any other
    table…

… sql ….

Declare @T Table ([column definitions here])
Insert @T Exec storedProcname params 
Select * from @T Where ...

Leave a Comment