title: Need to update many columns with unique values which matches with respective unique values condition is met
body: <p>I need to update 2 columns in the database of around 10,000 rows with unique values depending on the unique value of the column that is known to me.</p>
  
  <p>Column values I have:</p>
  
  <pre><code>tag_name
  xxxxx
  yyyyy
  zzzzz
  </code></pre>
  
  <p>Column values I need to update</p>
  
  <pre><code>tag_name     Hierarchical Name
  xxxx2        xxxx2
  yyyy2        yyyy2
  zzzz2        zzzz2
  </code></pre>
  
  <p>where tag_name = xxxxx the values of tag_name and hierarchical_name should change to xxxx2</p>
  
  <p>where tag_name = yyyyy the values of tag_name and hierarchical_name should change to yyyy2</p>
  
  <p>where tag_name = zzzzz the values of tag_name and hierarchical_name should change to zzzz2</p>
  
  <p>Can anyone help me to build a SQL query for this? I am new to this.</p>
  
  <p>Any help is highly appreciated and thanks in advance.</p>
  
  <p>This query i am running on 2014 sql server</p>
  
  <pre><code>UPDATE [PSRTMSCADA].[dbo].[gobject]
  SET tag_name= 'New_Crate 2',
  Hierarchical_Name = 'New_Crate 2'
  WHERE tag_name = 'Crate 1'
  
  SET tag_name = 'New_Monitor2',
  Hierarchical_Name = 'New_Monitor2'
  Where tag_name = 'Monitor'
  
          I am expecting to know how easily i can do this..
  </code></pre>