title: How convert bitmask to array in SQL (MSSQL)
body: <p>There is a bitmask stored as a string in table, like <code>"1010011"</code>.</p>
  
  <p>Is there a way to get a list of non-null bits using SQL query?</p>
  
  <p>For example:</p>
  
  <pre><code>'1010011' should give 1, 3, 6, 7
  '0000111' should give 5, 6, 7
  </code></pre>