I'm trying to call a sproc from within another sproc and putting the results in a temp table without first creating the temp table. Is it possible to do this, or is there a better way? I want to use the sprocB or functionB whose result set has multiple columns and multiple rows. thx.
sproc A
..
begin
-- create table #tmp.... -- Try not to create the #tmp table first if possible
exec sproc_B ... put results from sproc_B in #tmp
end
sproc B
..
@id int
..
begin
select table from aTable where id = @id
end
Similiar question was asked here.