In my stored procedure I need to insert a record in a particulat table using corresponded stored procedure. This procedure returns as a result a hell of fields, but what I need from the stored procedure is only content of columnd [Id].
So If there is a way to extract this information from stored procedure without a need of creating a temporary table or table variable that duplicates all the expected hell of fields and inserting the procedure result in it? Here I mean the folowing:
DECLARE @Reciever Table (field1 INT, Field2 varchar(255), ..., fieldn DateTime, ... fieldX float)
INSERT INTO @Reciever
EXEC ProcThatInserts @param1, @param2
How can I do the same without replicating structure of the stored procedure output into my table variable? Thanks!
P.S. The "ProcThatInserts" makes several insertions in different tables. Some of the inserts activete insert triggers which can make their own inserts