Click to See Complete Forum and Search --> : Login Stored Procedure


terbs
04-16-2007, 11:23 PM
I have used this stored procedure in the past and im wanting to use it again, but it wont seem to work.

When I execute it from Visual Studio 05 it says expects parameter @Result, which is an output parameter. I always get Result = 2, even if the login and password combination are correct. Any help would be great.


ALTER PROCEDURE dbo.sproc_Login

(
@Login varchar(50),
@Password varchar(50),
@Result integer OUTPUT
)

AS
IF

(SELECT
COUNT(*)
FROM COMPANY
WHERE (COMPANY.Login = @Login
AND COMPANY.Password = @Password)) = 1

SET @Result = '1'

ELSE

SET @Result = '2'

RETURN

russell
04-17-2007, 08:39 PM
and if u execute this in query analyzer/management studio what do u get with the values passed in?

SELECT
COUNT(*)
FROM COMPANY
WHERE Login = @Login
AND Password = @Password