简体   繁体   English

SQL Server 2012缺少RowVersion数据类型

[英]SQL Server 2012 missing RowVersion datatype

I recently restored my database onto a new SQL Server 2012 and notice that all my table columns of RowVersion data types have been changed to binary(8) 我最近将数据库还原到新的SQL Server 2012上,并注意到我的RowVersion数据类型的所有表列均已更改为binary(8)

In Management Studio when I design the tables, the drop down for the data types no longer even has a choice for rowversion . 在Management Studio中设计表时,数据类型的下拉列表甚至不再具有rowversion的选择。

I cant find anything from MS other than old information that says it should still exist, or that it is equivalent to binary(8) however binary(8) doesn't auto generate a value like rowversion or timestamp . 除了旧信息之外,我无法从MS中找到任何东西说它应该仍然存在,或者它等效于binary(8)但是binary(8)不会自动生成像rowversiontimestamp这样的值。

Thanks 谢谢

I haven't actually tried this but it should be something like: 我实际上没有尝试过,但是应该是这样的:

ALTER TABLE YourTable
ALTER COLUMN YourCol rowversion

I think it's by design. 我认为这是设计使然。 Conversion to binary(8) means that any values generated so far are preserved but in order to carry on auto-generating, you need to convert back to rowversion using the above. 转换为binary(8)意味着可以保留到目前为止生成的所有值,但是为了进行自动生成,您需要使用上述方法转换回rowversion

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM