I'm trying to write a procedure that will search in my table of members for a matching member with the username and password entered. It should output a 1 if a match is found.
Here is my code:
CREATE PROC LoginProcedure
@email varchar(50),
@password varchar(50),
@found bit output
AS
IF(EXISTS(SELECT *
FROM Members
WHERE email = @email AND password = @password))
BEGIN
@found = 1; ---HERE
END
ELSE
BEGIN
@found = 0; ----HERE
END
GO ---HERE
I have commented next to all the lines I'm getting errors at. The error is the same in all 3 lines.
Incorrect Syntax