title: SQL Server: Why isn't PWDCOMPARE() working?
body: <p>I am trying to match a password for the database users defined in <code>database/security/users</code> with the following query.</p>
  
  <pre><code>select 
      PWDCOMPARE(N'plain_password', password_hash)     -- 0
  from sys.sql_logins 
  where name = 'user'
  </code></pre>
  
  <p>It results in 0, where the correct password is provided. Why is this happening?</p>