title: Comma Separated Value to Multiple BIT Columns
body: <p>Hy , I have multiple values and i need a list of checks<br>
  ex:<br>
  <code>1,2,4,</code><br>
  <code>3,4,</code> should be : </p>
  
  <pre><code>day1 day2 day3 day4  
  _1____1____0____1
  _0____0____1____1
  </code></pre>
  
  <p>one method is  </p>
  
  <pre><code>CAST(CASE WHEN PATINDEX('1,', [day]) &gt; 0 THEN 1 ELSE 0 END AS BIT) as [day1],  
  CAST(CASE WHEN PATINDEX('2,', [day]) &gt; 0 THEN 1 ELSE 0 END AS BIT) as [day2],  
  CAST(CASE WHEN PATINDEX('3,', [day]) &gt; 0 THEN 1 ELSE 0 END AS BIT) as [day3],  
  CAST(CASE WHEN PATINDEX('4,', [day]) &gt; 0 THEN 1 ELSE 0 END AS BIT) as [day4]  
  </code></pre>
  
  <p>please help me with a better method because i have multiple columns<br>
  thanks</p>