title: How to implement a do-while loop in tsql
body: <p>I'm trying to figure how to implement this in TSQL</p>
  
  <pre><code>do 
    update stuff set col = 'blah' where that_row = 'the right one'
    select trash from stuff ...
  until some_condition
  </code></pre>
  
  <p>The only iterative control flow sentence provided by Transact-SQL is <code>while (condition) sentences</code> that first evaluates the condition and if that condition is true then execute the sentence.</p>
  
  <p>I'm thinking in a scenario like execute a UPDATE statement over a table until some condition triggered y the last UPDATE executed is achieved.</p>
  
  <p>Most important, I'm looking for the less-dirty approach to this problem (Duplicating the UPDATE before the WHILE does not make too much sense to me as the UPDATE sentence can be arbitrarily long and complex)</p>
  
  <hr>
  
  <p><strong>EDIT</strong>: The problem I'm trying to solve involve multiple UPDATE statements under the same table, each one taking and transforming the values from the previous iterations. This is not possible to do in just one big UPDATE statement, as each row will be evaluated and updated only once, so a loop is the only way I can figure out to make this mess to work.</p>