Guest User

Untitled

a guest
Dec 10th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. 1. Add column update_at_utc of type datetime2.
  2. 2. When inserting, update_at_utc = GETDATEUTC()
  3. 3. When retrieving, order by update_at_utc
  4. 4. When moving a row in the queue, for example between rows 3 and 4, simply take average of update_at_utc of these rows and use it to set update_at_utc of the row being moved.
  5.  
  6. 1. Remember update_at_utc of the row N places lower down
  7. 2. For all rows between the current and the new position: assign row's update_at_utc to the preceding row's update_at_utc
  8. 3. Assign update_at_utc of the row being moved to the date remembered in point 1 above.
Add Comment
Please, Sign In to add comment