SQL Server updating a time stamp column

后端 未结 5 1585
北荒
北荒 2020-12-03 13:55

In my database I have a timestamp column. I need to update a row in the table and need to update the timestamp column. When I run an update command

5条回答
  •  醉酒成梦
    2020-12-03 14:21

    You don't

    The timestamp column is updated automatically. Perhaps you are under the impression that timestamp contains a value relating to the time? It doesn't, but simply is a number which is updated whenever a value in that record is. Think of it like a row version number.

    From MSDN:

    The timestamp data type is just an incrementing number and does not preserve a date or a time.

提交回复
热议问题