troubleshooting Question

problem with creating simple stored procedure

Avatar of lucky20
lucky20Flag for United States of America asked on
Microsoft SQL Server
2 Comments2 Solutions358 ViewsLast Modified:
I have created stored procedure like below.

   @uname  varchar(20)
   @pword  varchar(20)
Select * From tbl_login
Where username = @uname and password1=@pword

while execution it is giving errors as

Incorrect syntax near '@pword'.

Must declare the scalar variable "@uname".

can't I declare two variables as varchar?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros