title: Using Update whilst using Select in SQL
body: <p>my SQL programming is limited which is why im having problem with this probably basic code. I am trying to update a record as im retrieving it, I know I can update it if I split it into two procedures but I would like to update the records that it is retreiving for consistancy sake. Anyway below is the code and hopefully it will show what I am trying to accomplish:</p>
  
  <pre><code>Update dbo.ASNs
      Set Sent = 'Yes'
      Where ASNNumber In
  (
      Select * From dbo.ASNs
      Where Sent = 'No'
      for xml auto, ELEMENTS, ROOT('ASNs')
  )
  </code></pre>