The SQL Server procedure returns multiple tables. Insert results into tables.

I have a procedure that returns multiple tables; eg:

PROCEDURE Something AS
BEGIN
 SELECT 1,2,3
 SELECT 4,5
 SELECT 9,10,11
END

I would like to extract each table from the result and insert it into a series of tables / temporary tables - one for each record set.

Is it possible?

+3
source share
3 answers

if you combine the results together, they will come out as one set of results.

your second query has only 2 columns, but this will need to be resolved anyway when you put it in a table.

+1
source

. , .

sp .

+1

Source: https://habr.com/ru/post/1703755/


All Articles