title: Find if correct password with hash and random salt
body: <p>I have a database with users and I want to have a random salt for each user that is saved in the column Salt and a hash of their salt+password in the field password.</p>
  
  <p>I can insert them like this:</p>
  
  <pre><code>INSERT INTO users([Username], [Password], [Salt])
  VALUES('David', HASHBYTES('SHA1', 'randomgeneratedsalt' + 'theirpw'), 'randomgeneratedsalt')
  </code></pre>
  
  <p>But how do I select them?</p>
  
  <p>My own try is:</p>
  
  <pre><code>select * 
  from users 
  where Username = 'David' 
    AND Password = HASHBYTES('SHA1', Salt + 'enteredpw')
  </code></pre>
  
  <p>Of course I can select the salt for the user that is trying to login, but I'd like to do it without doing so.</p>