title: How to populate a column with a count of numbers?
body: <p>I am converting to an integer primary key and am having trouble seeding the new column data with a count of integer numbers.</p>
  
  <p>Given an existing table:</p>
  
  <pre><code>create table t1 (
    Id uniqueidentifier, 
    NewId int,
    Data nvarchar(100)
  )
  </code></pre>
  
  <p>How would I update existing rows with a count of numbers from 1 to the # of rows in the result set?</p>
  
  <p>So:</p>
  
  <pre><code>|id      |NewId       |Data
  -------------------------------
  |ABC     |null        |first
  |DEF     |null        |second
  |GHI     |null        |third
  </code></pre>
  
  <p>Would become:</p>
  
  <pre><code>|id      |NewId    |Data
  ----------------------------
  |ABC     |1        |first
  |DEF     |2        |second
  |GHI     |3        |third
  </code></pre>
  
  <p>This is for a migration to using a hilo primary key with nhibernate, which is needed to reduce database round trips with between my application and database tiers, so IDENTITY is not an option for me.</p>