Problem with Stored Procedure
-
hi, i am writing a simple Stored Procedure [Sql Server 2000] to check employee's login ... this stored procedure.. supposed to return "YES" or "NO.. if login and password match... here is the code for stored procedure : ---------------------------------- CREATE PROCEDURE spCheckEmpLogin @Login char(6), @EmpPassword char(8) , @RetVal char(3) OUTPUT AS DECLARE @tmp char(4) SELECT @tmp = EmpPassword FROM tblEmployees WHERE Login=@Login IF @tmp <> @EmpPassword BEGIN @RetVal = 'NO' END RETURN; GO --------------------------------------- when i click on "Check Syntax" button.... server returns this error : Error 170: Line 11 : Incorrect Syntax near '@RetVal' ...................................................... well ... in line 11 : i am assigning 'No' to @RetVal... [it's a simple assignment].... can you please tell me what i am doing wrong???? thanx in advance
-
hi, i am writing a simple Stored Procedure [Sql Server 2000] to check employee's login ... this stored procedure.. supposed to return "YES" or "NO.. if login and password match... here is the code for stored procedure : ---------------------------------- CREATE PROCEDURE spCheckEmpLogin @Login char(6), @EmpPassword char(8) , @RetVal char(3) OUTPUT AS DECLARE @tmp char(4) SELECT @tmp = EmpPassword FROM tblEmployees WHERE Login=@Login IF @tmp <> @EmpPassword BEGIN @RetVal = 'NO' END RETURN; GO --------------------------------------- when i click on "Check Syntax" button.... server returns this error : Error 170: Line 11 : Incorrect Syntax near '@RetVal' ...................................................... well ... in line 11 : i am assigning 'No' to @RetVal... [it's a simple assignment].... can you please tell me what i am doing wrong???? thanx in advance
Hi, First of all, I think you posted this message in the wrong message board (this is C#). In answer to your question, line 11 should read like this: SET @RetVal = 'NO' Hope this helps! ~javier lozano (blog)