title: How to update a Sql Server table column while join two tables?
body: <p>I'm trying to update a column while joining it to another table. I've used below query, but it gave me error. </p>
  
  <pre><code>UPDATE  TABLE_2 
  INNER JOIN
        TABLE_1
  ON     (T2.ID=T1.ID)
  SET      TABLE_2.DEPT='HUMAN RESOURCE'
  WHERE    TABLE_2.DEPT='HR'
  AND T1.COMPANY =1 
  </code></pre>
  
  <p>Can anyone help me on this?</p>
  
  <p>Thanks.</p>