title: SQL update records with incrementing value starting from 1 each time
body: <p>I am adding batches of records to a table using a single insert statement.  I want each new batch to be allocated incrementing numbers, but starting from 1 each time.</p>
  
  <p>So, if I have</p>
  
  <pre><code>Batch    Name    IncementingValue
  1        Joe     1
  1        Pete    2
  1        Andy    3
  2        Sue     1
  2        Mike    2
  2        Steve   3
  </code></pre>
  
  <p>and I then add two records (using a single insert statement) :</p>
  
  <pre><code>3        Dave
  3        Paul
  </code></pre>
  
  <p>How can I run an update statement against this table so that Dave will be set to 1 and Paul to 2.  I don't want to use a cursor. </p>