This is a discussion on Username and Password verification in SQL stored procedure. within the Database Support forums, part of the Web Development category; Hi, I want to check whether the username and password are exists in the database or not using the Stored ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi, I want to check whether the username and password are exists in the database or not using the Stored Procedure in SQL server. Can anyone give me an idea to do this.
__________________ The OXYGEN Delivers edgy, intelligent Technology to all... |
| Sponsored Links |
| |||
| Hi, Hope this helps.. CREATE PROCEDURE [trainee].[empinfologin] (@username varchar(20), @password varchar(20), @values int output) AS declare @user varchar(20) declare @pass varchar(20) declare @result varchar(40) BEGIN select @user=username, @pass=password from empinfo where username=@username and password=@password if @user = @username and @pass = @password begin set @result='Success' set @values=1 return @values end else begin select @user=username, @pass=password from empinfo where username=@username if @user=@username and @pass!=@password begin set @result='Incorrect Password' set @values=2 return @values end else SET @result='User does not exist' set @values=3 return @values end END
__________________ S.Balasubramanian Nothing is impossible |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can we encrypt the username and password using PHP? | sundarraja | PHP Programming | 3 | 05-15-2008 07:29 AM |
| stored procedure | itbarota | Database Support | 3 | 03-10-2008 09:43 PM |
| how to get out parameter of stored procedure ? | Murali | PHP Programming | 0 | 12-16-2007 04:57 AM |
| Can a stored procedure call itself or recursive stored procedure? How many level SP n | H2o | Database Support | 1 | 08-03-2007 10:55 AM |
| Username,Password verfication in SQL Server 2005 itself using stored procedure | oxygen | Database Support | 0 | 07-20-2007 12:21 AM |