Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

SQLServer Timestamp format?

I'm accessing some legacy data stored in SQL Server, and my framework is convoluting the timestamp, so that I can't read or write to the field of type timestamp. Does anyone know the format SQLServer is looking for with a timestamp? (When I look at it in my third party tools, it just shows that it's binary data.)

Thanks in advance.

2 Answers

Relevance
  • Anonymous
    2 decades ago
    Favorite Answer

    It's dreaded timestamp in SQL server. Though the name says it is timestamp, it's really not. So don't do a read/write on that column. It's a kind of rowid precisely. By definition from SQL server books:

    "

    The SQL Server timestamp data type has nothing to do with times or dates. SQL Server timestamps are binary numbers that indicate the relative sequence in which data modifications took place in a database. The timestamp data type was originally implemented to support the SQL Server recovery algorithms.

    It further states Never use timestamp columns in keys, especially primary keys, because the timestamp value changes every time the row is modified.

    "

    Hope it helps.

  • 2 decades ago

    Usually, SQL databases store timestamps as the number of seconds since the Unix Epoch, January 1, 1970, 00:00:00 GMT. However, SQL Server does not actually use timestamps to mark the time; rather, it is an eight-bit number that is randomized everytime a datafield is modified. The reason you can only read it in binary is because that is all it is.

Still have questions? Get your answers by asking now.