convert a timestamp datatype

  • hiya,

    I want to convert an sql2k  'timestamp' dataype column  into the following:

    the data is input on the 15th of october, 2004 at 13:47

    I would like the value to display:

    15/10/2004   13:47:00

    I use the following code to try and convert:

    <code>

    convert(datetime, myTimestampColumn,103),

    <\code>

    the output in QA is:

    1900-01-01 00:00:02.710

    I have tried numerous conversions, but none seem to work.I have noticed that in the actual db table, the data is simply represented as "<Binary>"

    Is this normal?Also, the datatype for the column is:

    datatype = timestamp

    length = 8

    I will eventually be outputting to .net, but I can't even get it to convert properly in sql server..

    can anyone point out my idiocy?

    ta, yogi:

     

     

     

     

     

  • You can't. TIMESTAMP is not a date and time. It's a 'version'. Used to uniquely identify a row. It's changed everytime a row is modified.

    From the BOL:

    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.

    Remarks

    The Transact-SQL timestamp data type is not the same as the timestamp data type defined in the SQL-92 standard. The SQL-92 timestamp data type is equivalent to the Transact-SQL datetime data type.

    Refer to the BOL for more information.

    -SQLBill

    BOL=Books OnLine=Microsoft SQL Server's HELP

    Installed as part of the Client Tools

    Found at Start>Programs>Microsoft SQL Server>Books OnLine

  • Cheers, Bill.

    Looks like I'm livin in the past as far as sql datatypes are concerned 

    Thanks,

               yogi 

     

     

Viewing 3 posts - 1 through 2 (of 2 total)

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