I am trying to create a stored procedure in SQL Server 2008. According to the parser, the syntax is OK. However, when I try to execute the stored procedure and pass actual values, the following error comes up:
Msg 201, Level 16, State 4, Procedure
SaveOneTimeDonation, Line 0
Procedure or function ‘SaveOneTimeDonation’ expects parameter ‘@donation’, which was not
supplied.
Strange enough, the data is actually inserted into the table so I don’t know why it is displaying this error.
How can I solve this problem please? Here is the code:
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[SaveOneTimeDonation]
@donation float,
@date nvarchar
AS
INSERT INTO OneTime_Trans(Donation, Trans_Date) VALUES (@donation, @date)
exec SaveOneTimeDonation
The last line is executing the stored procedure. There it is missing the parameters.
Good luck!