November 16, 2007 at 6:53 am
i can execute the stored procedure X like this
exec x
this procedure returns the 10 rows ,in that rows one column name is empid
show after execution completed of the procedure X,
i want sum(empid) value
how to get it.
November 16, 2007 at 7:21 am
Return the results of the procedure into a temp table or table variable
November 18, 2007 at 8:13 pm
create procedure y
as
create table #tmp( empid int, column int)
insert into #tmp
exec x
select * from #tmp
select sum(empid) from #tmp
end
This will work as long as #tmp has the same definition as the result set as x.
(also note if you are returning to an application the program will have to go to the next record set after it reaches the first EOF to pull the data from the next select)
Paul Ross
November 19, 2007 at 2:07 am
thank u for u r replay
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply