title: SQL Server: How to check if values in a column match ALL the values from a subquery?
body: <p>I have a table with a column containing values in a comma-separated list, like so:</p>
  
  <pre><code>| ObjectID (int) | Column1 (nvarchar(max))|
  |              1 | 152, 154, 157, 158     |
  |              2 | 101, 154, 155          |
  |              3 | 97, 98, 99             |
  </code></pre>
  
  <p>I need to select all the ObjectIDs that have Column1 with ALL the integer values found in a particular string: '155, 154'. That way, only row with ObjectID = 2 should be returned, as it contains both 155 and 154 integers in its Column1 string.</p>
  
  <p>I was trying something like this:</p>
  
  <pre><code>DECLARE @SearchString nvarchar(max) = '155,154';
  SELECT *
  FROM ObjectsTable
  WHERE EXISTS
      (SELECT Data FROM dbo.SplitString(Column1, ',')
      WHERE Data = ALL (SELECT Data FROM dbo.SplitString(@SearchString, ',')))
  </code></pre>
  
  <p>But unfortunately, it does not return any records for me. Any idea how I can handle this, if it's even possible?</p>