Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Returning data from recursive SP

Author  Topic 

urosk
Starting Member

2 Posts

Posted - 2001-08-21 : 04:07:44
I have this problem, I have to return SUM from recursive
SP,

CREATE PROCEDURE GiveMeSum @sum as int

as

do some work
@sum=@sum+some_value

exec GiveMeSum @sum

return @sum

So when I call this SP from another SP like,

execute @mysum= GiveMeSum 0

I get wrong value from the stack, not real value that I
want. Is it a way to get real value without "tricks" like
storing sum into temp table, etc...

One more question how come I can't use create #table in trigger ?


Edited by - urosk on 08/21/2001 04:10:58
   

- Advertisement -