title: SQL Server If statement to update table value
body: <p>I'm trying  write a routine in SQL Server that, when run, would traverse specified tables and, if a specific column contains a value, update another value. In pseudo code:</p>
  
  <pre><code> select * from table1
   if column1 = true
   {
       update table2.column1 with value where table2.column2.value = table1.column2.value
   }
  </code></pre>
  
  <p>Basically, traverse <code>table1</code> and if the value in a specific column is true, update the value of another table's <code>column1</code> where that row's <code>column2</code> matches <code>table1</code>'s <code>column2</code></p>
  
  <p>Thanks</p>