[英]What is the benefit of using rowversion(timestamp) over LastModifyOn(DateTime) column in a table?
Problem: 问题:
I am working on asp.net application and my Intention is to confirm that a table row is updating only when it is not updated in between a user's request and submit . 我正在asp.net应用程序上工作,目的是确认仅当在用户的请求和Submit之间未更新表行时 ,该表行才会更新 。
Scenario 情境
X and Y both did not know whether invoice data are not altered in between. X和Y都不知道两者之间的发票数据是否未更改。
Solution-1 解决方案1
Solution-2 解决方案2
X and Y knows whether invoice data are altered in between or not. X和Y知道之间是否更改了发票数据。
Question: 题:
Now my question is what benefit we will get by using version(rowversion) column over LastModifyOn(DateTime)... 现在我的问题是,通过使用LastModifyOn(DateTime)上的version(rowversion)列,我们将获得什么好处...
Point: 点:
It looks as if you have decided (I might add, correctly) that timestamp/rowversion is better than datetime. 好像您已经确定(我可能会正确补充)时间戳/行版本比日期时间更好。 IMO it is up to you and the purpose. IMO取决于您和目的。 I will try to list down the differences between these two. 我将尝试列出这两者之间的差异。
PS: From v2008 onwards 'timestamp' is deprecated, so use rownumber (they are synonyms)*. PS:从v2008开始,不建议使用“时间戳”,因此请使用rownumber(它们是同义词)*。
*Source: http://msdn.microsoft.com/en-us/library/ms182776.aspx *来源: http : //msdn.microsoft.com/en-us/library/ms182776.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.