title: How to increment DateTime column by a second for every row?
body: <p>Suppose that I have this Time value: <code>09:00:00</code></p>
  
  <p>And I have a table with a column Time, and I have three records in it.</p>
  
  <p>I want to update those 3 records with that time but with the Time value incremented in one second each time (for every record).</p>
  
  <p>Something like this:</p>
  
  <pre><code>ColumnA   ColumnB
  1         09:00:00
  2         09:00:01
  3         09:00:02
  </code></pre>
  
  <p>How can I do that?</p>
  
  <p><strong>My Solution:</strong></p>
  
  <p>After some time working on my own solution, this is what I came up with</p>
  
  <pre><code>update tor1
  set ColumnB = dateadd(s,tor2.inc, ColumnB)
  from table1 tor1
  inner join (select ColumnA, ROW_NUMBER() OVER (Order by ColumnA) as inc from table1) tor2 on tor1.ColumnA=tor2.ColumnA
  </code></pre>