Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 return Username upon successful login...

Author  Topic 

stats
Starting Member

10 Posts

Posted - 2006-02-02 : 12:29:37
I've got it set to return the value 1 if the username and password match the database, but I would also like it to return the username... I tried placing another select statement within the IF clause, but it throws an error. Can anyone please provide any siggestions?

CREATE PROCEDURE userLogin
@userName char(16),
@userPass char(16)
AS
-- Make sure username and password is correct
IF EXISTS (SELECT userID, userName, userPass
FROM userTable
WHERE userName = @userName AND userPass = @userPass)
RETURN 1
GO

STaTs

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2006-02-02 : 12:32:59
Lookup BEGIN and END in Books Online..
Go to Top of Page

stats
Starting Member

10 Posts

Posted - 2006-02-02 : 12:46:38
thanks for the reply.. by books online, what do u mean?

STaTs
Go to Top of Page

stats
Starting Member

10 Posts

Posted - 2006-02-02 : 13:00:46
I've got it working. Thanks for pointing me in tha right direction.

STaTs
Go to Top of Page
   

- Advertisement -