When I tried to create this procedure. I received an error - at line "SET @ Num_of_User = (SELECT COUNT(*) AS Num_of_User" It said that " Server: Msg 170, Level 15, State 1, Procedure sp_ValidateUser, Line 8
Line 8: Incorrect syntax near 'Num_of_User'."
Does anyone know why? Thanks for your help.
CREATE PROCEDURE sp_ValidateUser
@UserName VARCHAR(50) = NULL,
@Password VARCHAR(50) = NULL,
@Num_of_User INT = 0
SET @ Num_of_User = (SELECT COUNT(*) AS Num_of_User
WHERE UserName = @UserName AND Password = @Password)