In your version of proc below, the problem is in line
if (select pwdcompare(@pwd,pwd,0) from tbl_login) = 1
select pwdcompare(@pwd,pwd,0) from tbl_login returns as many records as in
table tbl_login and this is not allowed when subquery is followed by = in
this case
Original version of this proc you submitted 9/21 looked much better, but as
Hugo mentioned - it is hard to help you as you haven't provided info of what
actually the problem that you have
Mikhail Berlyant
Eng.Manager
Yahoo! Music
[quoted text, click to view] "Muhammad Ahsin Saleem" <ahsin.saleem@gmail.com> wrote in message
news:1159162759.549285.87330@b28g2000cwb.googlegroups.com...
i have a problem that i have encrypted the user password but don't know
how to retrieve information against that user i have written a store
procedure but it does not work kindly if any body can help me, then do
help me its urgant
i have 4 collums in my tbl_login table
1. emp_name char 50 pk
2. uid char 20
3. cat char 10
4 pwd char 20
I have a form for login which takes input from the user. Input fields
are
1. User ID
2. User Password (pwd)
3. Category (cat)
after taking this information from user I have to check the user
validatioin If a user with the same uid, cat and pwd exist then I have
to select His/Her Name from table. When I run this store procedure
ALTER PROCEDURE dbo.SelectUserLogin
(
@id char(20),
@pwd char(20),
@cat char(10)
)
as
select * from tbl_login where uid=@id and cat=@cat
if (select pwdcompare(@pwd,pwd,0) from tbl_login) = 1
Return
Input values for this stored procedure are ahsin,ahsin123,Admin
it gives me following result with exception in it.
emp_name uid
cat pwd
-------------------------------------------------- --------------------
---------- --------------------
Muhammad Ahsin Saleem ahsin
Admin Subquery returned more than 1 value. This is not permitted
when the subquery follows =, !=, <, <= , >, >= or when the subquery is
used as an expression.
(1 row(s) returned)
@RETURN_VALUE = -6
Finished running dbo."SelectUserLogin".