Timestamp

  • Hi,

    My query is.....

    DECLARE

    @t timestamp

    SET

    @t=(select @@DBTS)

    Print

    @t

     

    But the following error is generated....

    Operand type clash: timestamp is incompatible with nvarchar

    Could u plz help me..

     

    Regards,

    Rajdeep

  • Good morning,

    It's the PRINT statement that is causing the error:

    -- declare variable

    DECLARE

    @t timestamp

    -- set variable

    SET

    @t = @@DBTS

    -- need to convert a timestamp to print it

    PRINT

    convert(varbinary, @t)

    -- to confirm

    PRINT

    @@DBTS

    Thanks,

    Dr. Michael Dye.

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

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