Converting timestamp values from Varchar to varbinary(8)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eugene

    Converting timestamp values from Varchar to varbinary(8)

    Hi,

    I have been battling with this for days now. If you execute the SQL below
    you will get the following result: 0x3078303030303 030, which is incorrect.
    It looks like the conversion is more literal than I am wanting. Does anybody
    know the correct way to convert a timestamp that has been stored as a char
    type, back into a varbinary(8)? (vb(8) is the suggested data type for
    storing timestamps)

    =============== ===============
    declare @strMinTimestam p varchar(18)
    declare @MinTimestamp varbinary(8)

    set @strMinTimestam p = '0x000000001A01 7FD8'

    set @MinTimestamp = convert(varbina ry(8), @strMinTimestam p)

    select @MinTimestamp
    =============== ===============

    thanks in advance!!

    Eugene


Working...