title: How to concatenate row values for use in WHERE clause of T-SQL query
body: <p>I want to write a query in T-SQL to perform a search on two concatenated columns. The two columns are fname and lname. Here is what I have so far:</p>
  
  <pre><code>SELECT
      fname,
      lname,
      ...
  FROM
      users
  JOIN
      othertable ON foo=bar
  WHERE
      fname+' '+lname LIKE '%query%'
  </code></pre>
  
  <p>SQL server doesn't like that syntax, though. How do I structure the query so that I can perform a WHERE LIKE operation that searches through two concatenated columns, allowing me to search the user's full name, rather than just first name and last name individually?</p>