Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get a value from a stored procedure
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01120807
Message ID:
01120830
Views:
18
>I need to return a money value from a stored procedure. I cant use a function because the procedure does an insert and an update. I can't use a stored procedure because return will only return integer, and if i use a select statement then i can't capture the value for further use in my calling procedure. What would be the best way to accomplish this?

What is the key for that row with the money value? I'd focus on using that, it's so much easier the beating on a SP. They really don't like that :)
create proc MyCallingProc 
(your params here inbound, your outbound one)

begin
declare @myKey int

-- key from money row below
set @myKey = exec ThatOtherProc(parmas here)

select MonyColumn from ThatTable where Pkey = @myKey
go

HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform