title: Get value under a column instead of columnname while updating in SQL Server
body: <p>I have <code>#Temp2</code> which has columns: </p>
  
  <pre><code>Math_Text, Science_Text, Physics_Text, Title
  </code></pre>
  
  <p>I need to run the query below:</p>
  
  <pre><code>update t
  set CombinedText = t2.Title + '_Text'
  from #Temp1 t
  inner #Temp2 t2 on t2.Id = t.Id
  </code></pre>
  
  <p>When I run it, for example, I see CombinedText = 'Math_Text' but I need the actual value under that column. What can I do? Thanks!</p>
  
  <p>EDIT1:</p>
  
  <pre><code>declare @sql nvarchar(max) = 'update t
      set CombinedText = t2.Title + ''_Text''
      from #Temp1 t
      inner #Temp2 t2 on t2.Id = t.Id
  '
  exec sp_executesql @sql 
  </code></pre>
  
  <p>did not work as well, t2.Title stays instead turning into its actual value.</p>
  
  <p>EDIT2:</p>
  
  <p><code>set CombinedText = c.[t2.Title+''_Text'']</code>  also did not work</p>