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.
Author |
Topic |
Mpilo
Yak Posting Veteran
52 Posts |
Posted - 2008-09-23 : 08:40:47
|
I have two tables for User table and member table i want a stored procedure that will chack if its user or a member who login |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-23 : 08:47:17
|
[code]CREATE PROC GetUserDetails@UserIDASSELECT *FROM Users uINNER JOIN Member mON m.UserID=u.UserIDWHERE u.UserID=@UserIDGO[/code] |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-09-23 : 08:48:34
|
SELECT UserName, Password, xFROM (SELECT UserName, Password, 'user' as x FROM UserUNION ALLSELECT UserName, Password, 'member' FROM Member) AS dWHERE UserName = @UserName AND Password = @Password E 12°55'05.63"N 56°04'39.26" |
|
|
Mpilo
Yak Posting Veteran
52 Posts |
Posted - 2008-09-23 : 09:15:32
|
But my problem is in the member table the username is column is namew as Surname. quote: Originally posted by Peso SELECT UserName, Password, xFROM (SELECT UserName, Password, 'user' as x FROM UserUNION ALLSELECT UserName, Password, 'member' FROM Member) AS dWHERE UserName = @UserName AND Password = @Password E 12°55'05.63"N 56°04'39.26"
|
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-23 : 09:17:37
|
Then show your strructures and illustrate what result you want. |
|
|
Mpilo
Yak Posting Veteran
52 Posts |
Posted - 2008-09-23 : 09:25:37
|
User table{Username varchar(30),Password varchar(30),Name varchar(30),Surname varchar(30)}member table{MemberName varchar(30),Surname varchar(30),Id int=0 ;MemberNo int=0;}the when the user login he use username and password and the member use Surname and Memberno.quote: Originally posted by visakh16 Then show your strructures and illustrate what result you want.
|
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-09-24 : 00:58:47
|
Use my query and substitute the column names and table names with your real column names.It can't be that hard, can it? E 12°55'05.63"N 56°04'39.26" |
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2008-09-24 : 01:38:33
|
When you say member are you using .net's inbuilt membership provider ? |
|
|
|
|
|
|
|