June 7, 2008 at 7:46 am
Hi
I have a local variable
Declare @ret int
and I have a stored procedure
that simply selects the sum of expense named as sp_SumTolat
I am trying this :
Set @ret = exec sp_SumTolat
This is not working could anyone please guide me as to what should i be doing?
June 9, 2008 at 8:41 am
Does your stored proc have an output parameter? If not, add one in the code to output the sum. Then execute as follows:
Declare @ret int
exec sp_SumTolat @ret output
select @ret
June 9, 2008 at 9:29 am
thanks for the help.
This is exactly what I required.
June 12, 2008 at 8:21 am
June 13, 2008 at 5:29 am
its nice that you asked.
Basically I was trying this first with a function but then found out that I cannot access a linked server from within a function.
So I had to take this stored procedure as an alternate.
Can i call a stored proceduere from within a function?
or can i call a databse in another server ?
or can i use open query in a function ?
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy