Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 re: comparing the encrypted values

Author  Topic 

ajnj
Starting Member

4 Posts

Posted - 2005-02-22 : 12:24:59
Hi all,
I am having trouble comparing the encrypted values. The stored procedure I have makes sense but I can't the encrypted values match up . Could you take a look? Thanks!!
CREATE proc sp_CheckPassword_bak
@initials char(3),
@passwd varchar(180)
as
declare @hashwd varchar(180)
exec master..xp_repl_encrypt @passwd output
select @hashwd = passwd from tblPassword where initials = 'abc'
if @@rowcount > 0
begin
if @hashwd = @passwd
return(0)
else
return(1)
end
else
return (100)
go

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2005-02-23 : 15:20:58
You are passing in @passwd as a parameter to sp_CheckPassword_bak and then overwriting it by using it as a parameter to xp_repl_encrypt with OUTPUT.

Can't resist... In general, don't use "sp_" as a prefix to your procedure name. There is a performancce hit associated with this.

HTH

=================================================================
Too many parents make life hard for their children by trying, too zealously, to make it easy for them. -Johann Wolfgang von Goethe, poet, dramatist, novelist, and philosopher (1749-1832)
Go to Top of Page
   

- Advertisement -