Skip to content Skip to sidebar Skip to footer

How To Generate Timestamp Value For Binary(8) Field?

I need two timestamp fields in my table. One, of the timestamp type for update operation, and the one (binary(8)) for the insert one. The timestamp type's value is auto generated

Solution 1:

I'm not sure to understand your problem but :

SELECT CONVERT(varbinary(8), CAST(CONVERT(DATETIME, GETDATE()) AS TIMESTAMP))

Post a Comment for "How To Generate Timestamp Value For Binary(8) Field?"