• sorry for the confusion. What i mean is even if they are on different SP, as long as they are within the session. It is possible to access the temporary tables.

    Try to store the resultset of your SP in a temporary table. then using the query below, you can identify the columns of the resultset of your two SP's

    here is the query:

    select * from tempdb.dbo.syscolumns a inner join tempdb.dbo.sysobjects b on a.id = b.id

    where b.name like '%#TEMP_TABLE%'

    Fetch all the columns and do some logic to create dynamic sql to build your tables.

    Now you have the tables. Insert the data from the resultset of the two SP and join the tables.

    I Hope you understand my explanation 🙂