Results 1 to 4 of 4

Thread: Time Stamp

  1. #1
    Join Date
    Aug 2001
    Location
    Bangalore , India
    Posts
    8

    Unanswered: Time Stamp

    Hello,

    When I give a query and retrieve the records, for the time stamp i am getting it in encrypted form.

    eg: its displaying like this 0x000100000267a13d

    Can anybody tell me how do I read this piece of Junk as a proper date and time.

    thanks

  2. #2
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    There is no column type of 'time stamp'. The two types of date columns are DATETIME and SMALLDATETIME.

    How are you inserting or updating data into the datetime column?

    How are you retrieving it?
    Thanks,

    Matt

  3. #3
    Join Date
    Jan 2002
    Posts
    28

    Thumbs up timestamp datatype is to avoid locking for updates

    Rajesh

    timestamp is an Adaptive Server supplied user-defined datatype that is defined as varbinary(8) NULL. Because timestamp is a user defined datatype, you can not use it to define other datatypes. timestamp datatype does not hold date or time value and cannot be convert into date or time . timestamp holds binary-type data .

    We can use tsequal function to check for timestamp value to prevent update on a row that has been modified since it was selected for browsing.

  4. #4
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    Ooops, I apologize, Raj is correct. There indeed *does* exist the 'special' type of timestamp (I was looking in my ASE Quick Ref guide which doesn't mention it). It sounds like you wish to know the date and time a row was last modified.

    If so, place an update trigger on the row which updates a datetime or smalldatetime with getdate()
    e.g.
    Code:
    UPDATE sometable
       SET somedatecol = getdate()
    Thanks,

    Matt

Posting Permissions

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