title: How can I check a uniqueidentifier is in a comma delimited list of ids?
body: <p>I am trying to insert some records into a many to many table, the condition though is that a particular Id (uniqueidentifier) is in a comman seperated list of Id's (nvarchar).</p>
  
  <p>I had thought it was working but it only seems to compare it to the first Id in the list?</p>
  
  <p>How can I correctly use the list to insert the data as I expect.</p>
  
  <p>Here is a snippet of my Sql:</p>
  
  <pre><code> INSERT LineItemToSalesTax (SalesTax_Id, LineItem_Id) 
      SELECT  st.Id, li.LineItem_Id
      FROM    @LineItems li
              ,SalesTax st 
      WHERE   li.AppliedSalesTaxes IS NOT NULL
      AND     st.Id in (li.AppliedSalesTaxes) 
  </code></pre>
  
  <p>li.AppliedSalesTaxes has a value in the following format: </p>
  
  <p><code>'C23E8882-A630-49B2-9E96-0313A4EC1C6A,3B96B6D4-85E7-4735-8351-1BD07FCFC395'</code></p>
  
  <p>I've tried a few scenarios and not quite got it working, I did spot a few articles that use Sql functions, but I would liket to avoid this if possible.</p>