IT Community - Software Programming, Web Development and Technical Support

Username,Password verfication in SQL Server 2005 itself using stored procedure

This is a discussion on Username,Password verfication in SQL Server 2005 itself using stored procedure within the Database Support forums, part of the Web Development category; Username and Password verification in SQL stored procedure. Goals: This stored procedure is used to verify username and password itself. ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 07-19-2007, 11:21 PM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 632
oxygen is on a distinguished road
Default Username,Password verfication in SQL Server 2005 itself using stored procedure

Username and Password verification in SQL stored procedure.


Goals:

This stored procedure is used to verify username and password itself.

Steps:

1) Create a stored procedure.

2) copy the following code.

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[ADO.NET + VB 2005] Master Detail insert - one stored procedure or divided ? bluesky ASP and ASP.NET Programming 6 07-13-2009 02:08 AM
Username and Password verification in SQL stored procedure. oxygen Database Support 1 12-23-2007 08:43 PM
Can a stored procedure call itself or recursive stored procedure? How many level SP n H2o Database Support 1 08-03-2007 09:55 AM
How to Send Mail Using Stored Procedure in MS SQL SERVER 200x?? Gopisoft Database Support 1 07-17-2007 08:43 AM
How Can we change the logon password in SQL Server 2005 ? mobilegeek Database Support 1 07-16-2007 01:39 AM


All times are GMT -7. The time now is 05:16 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0