title: Provide the values for a 'like' function from a specific column in a Table?
body: <p>I am using <code>SQL Server 2014</code> and I need a <code>T-SQL</code> query which uses the <code>like</code> function to run on a specific column (c1) of a Table (t1) to find out if it contains one of the codes from a list of codes found in the column (c2) of another Table (t2).</p>
  
  <p>To simplify, here is the scenario and the expected output:</p>
  
  <p>Table t1:</p>
  
  <pre><code>ID       Notes
  101      (free text in this column)
  102      ...
  ...      ...
  115000   ...
  </code></pre>
  
  <p>Table t2 (list of more than 300 codes):</p>
  
  <pre><code>Code
  FR110419
  GB150619
  ...
  DE111219
  </code></pre>
  
  <p>What I am looking for:</p>
  
  <pre><code>SELECT ID 
  FROM t1
  WHERE t1.Notes like (SELECT Code FROM t2)
  </code></pre>
  
  <p>Since the like operator needs '%'to work, I am confused as to how to construct that line.</p>
  
  <p>I have done some research on <code>StackOverflow</code> and the closest solution I have come across is for a <code>mysql</code> problem: <a href="https://stackoverflow.com/questions/1398720/how-to-use-like-with-column-name">how to use LIKE with column name</a></p>
  
  <p>Any type of help will be most appreciated.</p>