Thursday, March 22, 2012

Login Page

Please tell me how to write the stored procedure for the login page. The login page contains the UserName and Password. I want to check the entered value in the Database and check if the User is a valid user or not.I have a table information of few loginname and password.

Thanks.

this is not sql forum so you should post your query in other forum.

well, here is solution

store procedure

//Pass username and password to store procedure and get true or false as out put parameter

@.uname varchar(25),

@.password varchar(25) ,

@.IsExist bit out

declare @.ID int

set @.ID=(select id from tblUsername where username=@.uname and password=@.password)

if @.ID <> 0

set @.IsExist=1

else

set @.IsExist=0

Out put returns 1 if user exist otherwise it returns 0

0 comments:

Post a Comment