Using the result of an Stored procedure in a Select statement

后端 未结 5 617
暗喜
暗喜 2021-01-20 15:27

I have a stored procedure which returns a Dataset(Table). How can I use the result of this stored procedure in a SELECT statement?

I need s

5条回答
  •  庸人自扰
    2021-01-20 15:38

    I agree with Marcelo mostly, but if you are set on using a stored procedure, or your stored procedure does anything that affects data, you could create a #temp table with the structure of the output of your stored procedure, and then do something like

    INSERT INTO #temp
    EXEC [dbo].[SPGetResults] '900',300,'USD'
    

    And then do your joins and selects on the temp table.

提交回复
热议问题