简体   繁体   English

Microsoft SQL Server Management Studio说RowVersion是无效类型

[英]Microsoft SQL Server Management Studio says that RowVersion is invalid type

Is there a way when creating a tables through Microsoft SQL Server Management Studio, to specify a field as RowVersion rather than Timestamp? 通过Microsoft SQL Server Management Studio创建表时,是否可以将字段指定为RowVersion而不是Timestamp?

This is what I get when I try to use rowversion as a type of a field: 这是我尝试将rowversion用作字段类型时得到的:

在此处输入图片说明

I am on Windows 7 64bit, SQL Server 2014 Express, and Microsoft SQL Server Management Studio 17.1 我使用的是Windows 7 64位,SQL Server 2014 Express和Microsoft SQL Server Management Studio 17.1

Don't have enough reputation to post a comment. 没有足够的声誉来发表评论。 This has been asked before. 这已经被问过了。 below is the link 以下是链接

if you are using GUI,then use TimeStamp' which is how rowversion` is stored under the hoods 如果您使用的是GUI,则使用TimeStamp' which is how rowversion在后台存储的方式

CREATE TABLE dbo.x(y ROWVERSION);

even the above ddl under the hoods will be stored as Timestamp ,you can verify the same using below 即使上面的ddl都将被存储为Timestamp ,您可以使用下面的命令进行验证

SELECT t.name 
  FROM sys.types AS t
  INNER JOIN sys.columns AS c
    ON c.system_type_id = t.system_type_id
  INNER JOIN sys.tables AS st
    ON c.[object_id] = st.[object_id]
  INNER JOIN sys.schemas AS s
    ON st.[schema_id] = s.[schema_id]
  WHERE st.name = N'x'
    AND s.name = N'dbo'
    AND c.name = N'y';

References: 参考文献:
https://dba.stackexchange.com/questions/86523/microsoft-recommends-using-rowversion-over-timestamp-but-i-can-not-find-rowve https://dba.stackexchange.com/questions/86523/microsoft-recommends-using-rowversion-over-timestamp-but-i-can-not-find-rowve

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

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