本文介绍了SQL Server RowVersion / Timestamp - 比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 在 rowversion 列中插入增量数据库 rowversion

Each database has a counter that is incremented for each insert or update operation that is performed on a table that contains a rowversion column within the database. This counter is the database rowversion. This tracks a relative time within a database, not an actual time that can be associated with a clock. Every time that a row with a rowversion column is modified or inserted, the incremented database rowversion value is inserted in the rowversion column.


  • 据我所知,系统中没有同时发生的动作。这意味着所有 rowversion s应该是唯一的。我冒昧地说,如果在同一个表内允许重复,它们实际上是无用的。还给予 rowversion 不重复的信任是MSDN的不使用它们作为主键的立场,不是因为它会导致违反,而是因为它会导致外键问题。 li>
  • 根据MSDN,rowversion数据类型只是一个递增的数字...所以是,后来更大。

  • As far as I understand, nothing ACTUALLY happens simultaneously in the system. This means that all rowversions should be unique. I venture to say that they would be effectively useless if duplicates were allowed within the same table. Also giving credance to rowversions not being duplicated is MSDN's stance on not using them as primary keys not because it would cause violations, but because it would cause foreign key issues.
  • According to MSDN, "The rowversion data type is just an incrementing number..." so yes, later is larger.

对于增加的问题,MSDN指出:[ rowversion ]跟踪数据库中的相对时间这表示它不是一个流体整数递增,而是基于时间。但是,这个时间在确切时不显示任何内容,而是在相对于其他行插入/修改行。

To the question of how much it increments, MSDN states, "[rowversion] tracks a relative time within a database" which indicates that it is not a fluid integer incrementing, but time based. However, this "time" reveals nothing of when exactly, but rather when in relation to other rows a row was inserted/modified.

这篇关于SQL Server RowVersion / Timestamp - 比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 20:02