title: get Last value of a column in sql server
body: <p>I want to get the last value of a column(it is not an identity column) and increment it to the value of corresponding row number generated.</p>
  <pre><code>Select isnull(LAST_VALUE(ColumnA) over(order by ColumnA), 0) + 
         ROW_NUMBER() OVER (ORDER BY ColumnA)
  from myTable
  </code></pre>
  <p>I am calling my sp recursively hence why I thought of this logic.
  But it is not working.</p>
  <p>I basically wanted, for first time 1-9 for second run (if recursively being called 2 times) 10-19 and so on.</p>