11

I'm wonder if it's safe to compare the values of timestamp in a table to get the newly updated/inserted rows. (e.g. SQL Server RowVersion/Timestamp - Comparisons).

What will happen if timestamp reaches the maximum value of binary(8) in a very very large/frequently updating database?

Community
  • 1
  • 1
ca9163d9
  • 27,283
  • 64
  • 210
  • 413

1 Answers1

19

It won't.

If you do a million updates a second, every second, the timestamp will wrap around in about 585000 years.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
  • It won't happen. But still, just by mere curiosity, does SQL Server handle this in some way? – Guillermo Gutiérrez Oct 23 '13 at 14:55
  • 1
    @guillegr123: I looked for a while now, and I can't find any documentation for that. I found a claim that it would actually wrap around to zero in an answer, but there is no reference to any documentation to back it up. http://stackoverflow.com/a/547782/69083 – Guffa Oct 23 '13 at 19:06