title: TSQL Where clause inside string query
body: <p>My query:</p>
  
  <pre><code>SET @s_query =
  
  'Select ROW_NUMBER() OVER (ORDER BY ' + @ColNames + ') AS ##RowNum, 
  '+@ColNames+' INTO ##Results' +
  ' From TableA
  Where FirstName = ' +@Search+ ' 
  ORDER BY FirstName';
  </code></pre>
  
  <p>I am running the stored procedure with parameters: </p>
  
  <pre><code>@Search = 'Adam', @ColName = 'FirstName','LastName'
  </code></pre>
  
  <p>And getting the error:</p>
  
  <pre><code>" Invalid column name 'Adam'.
  </code></pre>