title: How to change identity column values programmatically?
body: <p>I have a MS SQL 2005 database with a table <code>Test</code> with column <code>ID</code>. <code>ID</code> is an identity column. </p>
  
  <p>I have rows in this table and all of them have their corresponding ID auto incremented value.</p>
  
  <p>Now I would like to change every ID in this table like this:</p>
  
  <p><code>ID = ID + 1</code></p>
  
  <p>But when I do this I get an error:</p>
  
  <blockquote>
    <p>Cannot update identity column 'ID'.</p>
  </blockquote>
  
  <p>I've tried this:</p>
  
  <pre><code>    ALTER TABLE Test NOCHECK CONSTRAINT ALL 
      set identity_insert ID ON
  </code></pre>
  
  <p>But this does not solve the problem.</p>
  
  <p>I need to have identity set to this column, but I need to change values as well from time to time. So my question is how to accomplish this task.</p>