title: t-sql get variable value from string with variable name
body: <p>Is there a way to convert <code>@my_variable</code> string into a value of <code>@my_variable</code>?</p>
  
  <p>I have a table which stores names of variables. I need to get the value of this variable. Something like this:</p>
  
  <pre><code>DECLARE @second_variable AS NVARCHAR(20);
  DECLARE @first_variable AS NVARCHAR(20);
  SET @first_variable = '20';
  SET @second_variable = SELECT '@first_variable'; --here I want that @second variable be assigned a value of "20".
  </code></pre>