title: Is there a way to SELECT and UPDATE rows at the same time?
body: <p>I'd like to update a set of rows based on a simple criteria and get the list of PKs that were changed. I thought I could just do something like this but am worried about possible concurrency problems:</p>
  
  <pre><code>SELECT Id FROM Table1 WHERE AlertDate IS NULL;
  UPDATE Table1 SET AlertDate = getutcdate() WHERE AlertDate IS NULL;
  </code></pre>
  
  <p>If that is wrapped in a transaction are there any concurrency issues that can occur? Or is there a better way to do this?</p>