SQL Server Performance

how to convert timestamp to datetime value

Discussion in 'General Developer Questions' started by motioneye, Sep 9, 2005.

  1. motioneye New Member

    Hi,
    Can I convert timestamp value to current time values?
    when I convert select CAST (0x00000000000067FB as datetime )
    it giving me oudated values 1900-01-01 00:01:28.730
  2. merrillaldrich New Member

    You can't. Though it has a misleading name, a timestamp is neither a date nor a time. See BOL:

    timestamp

    timestamp is a data type that exposes automatically generated binary numbers, which are guaranteed to be unique within a database. timestamp is used typically as a mechanism for version-stamping table rows. The storage size is 8 bytes.


    --------------------------
    Yes, I am a geek. I know. I can't help it.
  3. Madhivanan Moderator

    There is no datatype called Time in SQL Server<br />The only way is to use Convert function<br /><br />select convert(varchar,CAST (0x00000000000067FB as datetime),10<img src='/community/emoticons/emotion-11.gif' alt='8)' /><br /><br /><br />Madhivanan<br /><br />Failing to plan is Planning to fail
  4. FrankKalis Moderator

Share This Page