Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2006
    Posts
    115

    Unanswered: timestamp sequence

    timestamp is binary value .. but will the newly updated one be the greatest on within database?

  2. #2
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    I believe so, but be aware that timestamp values will roll over and start over at 0...

    Michael

  3. #3
    Join Date
    Jul 2006
    Posts
    115
    oh ... i want to use the value to "filter" out the newly amended(both insert & update) records in the db .... any other suggestion?

  4. #4
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    Well - it's an 8 byte binary value, so the roll-over will only happen in rare circumstances. You may still be able to use it if you have a way of comparing the values to a base-line that determines the cut-off.

    Other options include a last_modified_date column, with a trigger that updates it... (clunky, but it may be more reliable in the long run)

    Michael

  5. #5
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    If you are looking for a unique value, you should use the GUID function. This guranteed to be unique at all times across all servers.

  6. #6
    Join Date
    Jul 2006
    Posts
    115
    how many combination for timestamp (ie varbinary(8)) ?
    e.g tinyint - > value range is 0-255

  7. #7
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    2^64 is a pretty large number, however I don't think that it is simply incremented by one for each insert/update...

    Michael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •