SQL Server updating a time stamp column

后端 未结 5 1588
北荒
北荒 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:10

    timestamp column cannot be updated since it is server generated and is gauranteed to be unique for the entire database - if updates were allowed, which it is not, then the value is not gauranteed to be unique.

    i faced same problem trying to update the timestamp column in a replicated instance because the replicated instance did not have the same timestamp value as the publisher - which caused some problems when trying to obtain the last updated record per group of records. of course, with replication, it was a simple configurationg at the publisher to enable the same timestamp value to replicate over to the subscriber.

    otherwise, there is no other way to update a timestamp value.

提交回复
热议问题