Create Table #a (UseName Char (10), Passwrd Varbinary (200)) - Password Field Insert #a (UseName, Passwrd) VALUES ('BB', PWDENCRYPT ('654321'))
Declare @pwd varbinary (200) SELECT @ PWD = Passwrd from #a where useename = 'bb'
IF PWDCompare ('654321', @ PWD) = 1Print 'true'lse print' false '
Select * from @logintable