title: How renumber a column after deleting a record
body: <p>My temporary table has a column holding a sequential numeric "row number".</p>
  
  <p>How can I create a update this "row number" column when a record is deleted from the table?</p>
  
  <p>Example </p>
  
  <pre><code>ID    Name    Row_Number
  1     Jack    1
  14    John    2
  17    Bella   3
  </code></pre>
  
  <p>If I delete record with ID=14, I'd like record with ID=17 to be updated to be row_number 2</p>
  
  <p>I've tried this:</p>
  
  <pre><code>SET @deletestr = ' DELETE FROM  ' + @tablename
          + ' where isnull(ltrim(rtrim([Row_Number])),0)=isnull(ltrim(rtrim(@originalRow_Number)),0)'
  </code></pre>