How to generate timestamp value for binary(8) fiel

2019-08-04 16:15发布

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 by the sql server, Where to get the value for that second column from?

1条回答
Rolldiameter
2楼-- · 2019-08-04 17:04

I'm not sure to understand your problem but :

SELECT CONVERT(varbinary(8), CAST(CONVERT(DATETIME, GETDATE()) AS TIMESTAMP))
查看更多
登录 后发表回答