Capturing Output Parameter Value
When I execute my stored procedure, I get the following error message:
Procedure or function 'usp_InsertEmployeesTodaysLogin' expects parameter '@Cnt', which was not supplied.
No rows affected.
(0 row(s) returned)
@Cnt =
@RETURN_VALUE =
Finished running [dbo].[usp_InsertEmployeesTodaysLogin].
My stored procedure is:
ALTER PROCEDURE dbo.usp_InsertEmployeesTodaysLogin
(
@UserID char(8),
@Today datetime,
@SSNLogon char(15),
@Cnt int output
)
as
BEGIN
select @Cnt=count(UserID) FROM ATTTblAttendance
WHERE (UserID=@UserID and Today=@Today and SSNLogon = @SSNLogon)
RETURN @Cnt
If (@Cnt=0)
BEGIN
INSERT INTO ATTTblAttendance
(UserID, Today, SSNLogon)
VALUES (@UserID,@Today,@SSNLogon)
END
ELSE
RETURN @Cnt
END
I need to capture @Cnt for use in my ADO.NET app.
Appreciate your assistant.
Gail
|