title: Update a column of a table to be a sequence
body: <p>I want to update a table's column using the results of a stored procedure</p>
  
  <pre><code>create procedure seq
  as
  DECLARE @NextValue INT;
  INSERT SequencesTable DEFAULT VALUES;
  DELETE SequencesTable WITH(READPAST); 
  SELECT SCOPE_IDENTITY();
  go
  </code></pre>
  
  <p>I can't use a UDF since it is nodeterministic. Something like this won't work</p>
  
  <pre><code>UPDATE [dbo].[t1]     SET [c1] = seq
  </code></pre>
  
  <p>I have a feeling I am approaching this the wrong way.</p>
  
  <p>I just want to do update a table that looks like this</p>
  
  <p>1 1<br>
  2 2<br>
  1 4<br>
  1 4<br>
  5 5<br>
  1 2  </p>
  
  <p>To look like this</p>
  
  <p>1 1<br>
  2 2<br>
  3 4<br>
  4 4<br>
  5 5<br>
  6 2  </p>