title: Retrieving affected records through T-SQL
body: <p>Following sample returns affected ROWCOUNT.  Is there a way to return affected IDENTITYs?</p>
  
  <pre><code>UPDATE HumanResources.Employee 
  SET JobTitle = N'Executive'
  WHERE NationalIDNumber = 123456789
  IF @@ROWCOUNT = 0
  PRINT 'Warning: No rows were updated';
  </code></pre>