How to SELECT [temp table1] = [subselect 1], [temp table2] = [subselect 2] FROM [Stored Procedure]
问题 I have a stored procedure that returns two selects, which I use in a report. The first select is data to display in tabular format and the second are metadata to display in the report head, like showed below: CREATE PROCEDURE dbo. GetReport @Input INT AS BEGIN --Get #Metadata -- #Results = f(#Metadata) … compex calculation SELECT * FROM #Results SELECT * FROM #Metadata END As the sproc calculation is quite intensive, I would like to prepare the report lines as plain data (in two tables: