Krishna1 (4/30/2013)
HiI am uisng following code. How do create a table for insert into when 2 resul sets are differnt? Please advice.
CREATE procedure PROC1 as
begin
Select 'aaa',1
select 1,2.22,'xxx'
end
go
DROP PROCEDURE PROC2
go
Create procedure PROC2 as
BEGIN
INSERT INTO #temp
EXECUTE PROC1
SELECT * FROM #temp
END
go
execute PROC2
Regards
Krishna
I think you might find that INSERT...EXEC will let you down in that instance. I don't believe you can capture multiple resultsets with it.
In fact, as I think about it, the only way that comes to my mind to handle that kind of thing anywhere near gracefully would be with the CLR.
I'm assuming you don't have the option of altering the Procedure itself?