title: SQL Update - variables
body: <p>I've been stuck with a problem with SQL , about updating table (couldn't find answer anywhere).</p>
  
  <p>The problem looks like:</p>
  
  <pre><code>Update TABLE1
      SET @variable1 = @variable2
      WHERE SomeColumn = @variable3;
  </code></pre>
  
  <p>Where variable1 and variable3 is type of varchar(50) , and variable2 is type of int. How can I make this working? I've been trying with EXEC or many other simple options, but they seem not working for me.</p>
  
  <p>In the code example I've given here, value from variable2 is assigned to variable1 instead of a column with name equals to variable1, and when I try with Exec, It can't read variable2 (because of int type) properly.</p>