Sunday, December 23, 2012

Password in SQL


DECLARE @PWD varbinary(128)
SELECT @PWD = PWDENCRYPT ( 'password' )
SELECT @PWD
-- Correct
SELECT PWDCOMPARE('password', @Pwd )  -- 1
-- Failed
SELECT PWDCOMPARE('bla-bla-bla', @Pwd )  -- 0

No comments: