Hi friends,
I am getting an error,can someone plzz point out where i am going wrong:
Must declare the scalar variable "@UserID".
Stored procedure is:
CREATE PROCEDURE dbo.spRetrieveBalance AS
SELECT Balance from Account WHERE
UserID=@UserID
Thank you
Loading


Rajesh Kumar14 reputationPosted Dec 20, 2010, 10:59 PM EST
Modify your's given statement like this:
CREATE PROCEDURE [dbo].[spRetrieveBalance ]
@UserID int
AS
Begin
Santhosh NRank #4,788 · 325 reputationPosted Dec 20, 2010, 10:25 PM EST
write something like this..
CREATE PROCEDURE dbo.spRetrieveBalance @UserID
AS
SELECT Balance from Account WHERE
UserID=@UserID
Satish BhatRank #2,496 · 563 reputationPosted Dec 20, 2010, 10:55 PM EST
e.g.
CREATE PROCEDURE dbo.spRetrieveBalance
@UserID int / varchar(20) / ...
AS
SELECT Balance from Account WHERE UserID=@UserID
B M SuchitraRank #2,922 · 492 reputationPosted Dec 20, 2010, 11:29 PM EST
Suthish NairRank #92 · 22.8K reputationPosted Dec 21, 2010, 11:39 PM EST
Mark the reply that helped you as accepted answer.