i'm trying to execute the following SQL 2008 code it says there is a problem near "=" and "else"... i cant understand what is wrong with the code
ALTER PROCEDURE dbo.LoginEmp @username NVARCHAR(10),
@password NVARCHAR(10),
@confirm INT output,
@emp_name NVARCHAR(50) output,
@emp_id BIGINT output
AS
IF EXISTS (SELECT @emp_id = emp_id,
@emp_name = emp_name_ara
FROM Employee
WHERE ( emp_username LIKE @username
AND emp_password LIKE @password ))
BEGIN
SET @confirm=1
INSERT INTO EmployeeLog
(log_emp_id,
log_act_id,
log_date,
log_data)
VALUES (@emp_id,
1,
GETDATE(),
-1)
END
ELSE
BEGIN
SET @confirm=0
END
RETURN