title: What Microsoft tSql code will create "Group Identifiers" for groups of rows delimited by a 1
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>--drop table GroupIdentifierTest
  go
  Create table GroupIdentifierTest
  (
  RowId varchar(10),
  [Delimiter] int
  )
  
  insert into GroupIdentifierTest
  select 'a', 0 union all
  select 'b', 0 union all
  select 'c', 0 union all
  select 'd', 1 union all
  select 'e', 0 union all
  select 'f', 1
  select * from GroupIdentifierTest
  delete GroupIdentifierTest
  insert into GroupIdentifierTest
  select 'a', 1 union all
  select 'b', 1 union all
  select 'c', 1 union all
  select 'd',  2 union all
  select 'e', 2 union all
  select 'f', 2
  select r.RowId, r.Delimiter As GroupId from GroupIdentifierTest r</code></pre>
  </div>
  </div>
  </p>
  
  <p>If you have a rowset, and the data is in groupings, indicated by a column value of 1,  how can you generate GroupId numbers?</p>
  
  <p>In this example, the first rowset needs to be transformed into the second rowset.</p>