title: SQL NOT LIKE with multiple values
body: <p><em>UPDATE</em> </p>
  
  <p>I was able to find my solution by leveraging NOT EXISTS. Thus, my and statement looks like this: </p>
  
  <pre><code>and NOT EXISTS (select RejectCode from #rejects where od.UnitDescription LIKE ('%' + RejectCode + '%'))
  </code></pre>
  
  <p>This leverages a temp table #results in which I'm storing the 184 reject codes. THANK YOU everyone who responded. I went down each route, learned a few things, and the responses led me to the solution.</p>
  
  <p>Post -> CTE -> Temp Table (couldn't assign a variable right after the CTE) -> Join on LIKE -> NOT EXISTS</p>
  
  <p><em>UPDATE</em></p>
  
  <p>I'm attempting to filter a query with a lot of conditions - the nested select statement below returns 184 reject codes. I have a unit description coming back that is a VARCHAR(100) and inside it contains a code (not in a static spot).</p>
  
  <p>I'm attempting to do the following (summarized select for simplicity):</p>
  
  <pre><code>select od.*, o.*
  from OrderDetails od
  join Orders o ON o.oKey = od.oKey
  where CustomerID = '104'
    and od.UnitDescription NOT LIKE (select RejectCode
                                     from [CustDiscountTables].[dbo].RejectDiscount 
                                     where GroupID = '15' 
                                       AND (DiscountPercent = '1' 
                                            or DiscountPercent = '.4' 
                                            or DiscountPercent = '.2'))
  </code></pre>
  
  <p>Previously I only had to filter on only a couple codes, so I simply did "and (od.UnitDescription NOT LIKE '%a%' and od.UnitDescription NOT LIKE '%b%' and ...etc). My question would be: How do I use NOT LIKE, or something similar (since the UnitDescription is not static and contains more than just the reject code), to filter all of the codes returned from the nested select statement? Am I really doomed to write out "NOT LIKE" 184 times?</p>