Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server stored procedure help
Message
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
SQL Server stored procedure help
Divers
Thread ID:
00313586
Message ID:
00313586
Vues:
65
If I call the following stored procedure with ("user","password"), it returns one matching record, like it's suppose to.
CREATE Procedure VerifyLogin
	@UserID varchar(50),
	@Password varchar(50)
)
As
	select AccountID, 
		FirstName + ' ' + LastName AS Name
	from accounts
	where UserID = @UserID
	and Password = @Password

	return @@ROWCOUNT

<B>However, if I call this next stored procedure with ("user","password",1234,"Name"), it returns no matching record.</B>

CREATE Procedure VerifyLogin
(
	@userid varchar(50),
	@Password varchar(50),
	@AccountID int,
	@Name varchar(100)
)
As
	select @AccountID = AccountID, 
		@Name = FirstName + ' ' + LastName
	from accounts
	where userid = @userid
	and Password = @Password

	return @@ROWCOUNT
What am I doing wrong in regards to assigning value to variables as parameters?
It's "my" world. You're just living in it.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform