Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server stored procedure help
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00313586
Message ID:
00313823
Vues:
29
John,

You have to declare @AccountID and @Name as output parameters like this:
CREATE Procedure VerifyLogin
(
@userid varchar(50),
@Password varchar(50),
@AccountID int OUTPUT,
@Name varchar(100) OUTPUT
)
As
.......

>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?
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform