Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server stored procedure help
Message
From
05/01/2000 18:15:38
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
SQL Server stored procedure help
Miscellaneous
Thread ID:
00313586
Message ID:
00313586
Views:
67
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.
Next
Reply
Map
View

Click here to load this message in the networking platform