September 8, 2013 at 6:56 am
Hello mates.
I want to create a procedure with follow two sentences.
DECLARE @Wallet int
SET @Wallet = EXEC HowMoneyIsInTheWallet @IDOsoby
And I have this error: Incorrect syntax near the keyword 'EXEC'.
How resolve the problem ?
September 8, 2013 at 10:17 am
Hi sasia
you need to define output parameter to your procedure
for example
create procedure HowMoneyIsInTheWallet
(
@IDOsoby int,
@Wallet int OUTPUT
)
AS
-- your code where you set value to @Wallet
return @Wallet
call the stored procedure
DECLARE @WalletReturned int, @Wallet int
EXEC @WalletReturned = HowMoneyIsInTheWallet @IDOsoby, @Wallet output
print @WalletReturned
September 8, 2013 at 12:13 pm
Thank you SrcName for your answer.
You help me, and i am thankfull you for that
I wish you have a nice day
Enjoy
Viewing 3 posts - 1 through 3 (of 3 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