title: In SQL, how can I split the values in a bitmask total into a comma delimited string
body: <p>I have a bitmask value stored as an int in sql. I'd like to turn that value into a comma separated list of the values contained in the bitmask value. </p>
  
  <p>So, for example, the results might look like so:</p>
  
  <pre><code>id  name      bitMaskValue   values
  ----------------------------------------
  1   Bob       5              1,4
  2   Mary      13             1,4,8
  3   Stan      11             1,2,8
  </code></pre>
  
  <p>Is there a way to accomplish this in a sql statement?</p>
  
  <p>This is SQL Server 2008.</p>