timestamp to datetime

  • I have a colume and with that have a timestamp and when do a select it give me

    0x0000000000000BB9

    0x0000000000000BBA

    0x00000000000007D4

    0x00000000000007D5

    I need to change timestamp (rowversion ) column to a datetime that is readable ..

    I cant came up with a code ..need help

  • timestamp, despite it's name, has nothing to do with time. It's a binary value unique within the DB that changes whenever the row is changed. It's more a row version than anything else

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Did you try using the CAST function?

    CAST(0x0000000000000BB9 as DATETIME)

    CAST(0x0000000000000BBA as DATETIME)

    CAST(0x00000000000007D4 as DATETIME)

    CAST(0x00000000000007D5 as DATETIME)

    HTH

    Fraggle

  • Fraggle (9/29/2008)


    Did you try using the CAST function?

    It may convert, but the conversion will be completely meaningless. timestamp is not in anyway related to a time.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You are correct Gail. I just saw it was in binary format and automatically figured the cast function would work. Didn't even test it. After testing it, the cast does give you data and puts it in datetime format, but as you said, it is bad data and useless. 🙂

    Fraggle.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply