This MSDN page states:
此MSDN页面指出:
A nonnullable rowversion column is semantically equivalent to a binary(8) column. A nullable rowversion column is semantically equivalent to a varbinary(8) column.
不可空的rowversion列在语义上等同于二进制(8)列。可空的rowversion列在语义上等同于varbinary(8)列。
Given that a nonnullable rowversion column is semantically equivalent to a binary(8) column, why say a nullable rowversion column is semantically equivalent to a varbinary(8) column and not a nullable binary(8) column?
鉴于不可存活的rowversion列在语义上等同于二进制(8)列,为什么可空的rowversion列在语义上等同于varbinary(8)列而不是可空的二进制(8)列?
Does this imply a nullable rowversion column isn't semantically semantically equivalent to a nullable binary(8) column?
这是否意味着可空的rowversion列在语义上在语义上不等于可空的二进制(8)列?
My particular example is that I will have a table that will contain copies of rows from other tables. Some source tables have a rowversion and others don't. Therefore, the "rowversion" column in my table must accept null values. I want to understand why (or if) the column should be varbinary(8) null instead of binary(8) null.
我的具体例子是我将有一个表,其中包含来自其他表的行的副本。某些源表具有rowversion而其他源表没有。因此,我的表中的“rowversion”列必须接受空值。我想了解为什么(或者如果)列应该是varbinary(8)null而不是binary(8)null。
1 个解决方案
#1
1
A binary(8) is a binary that has EXACTLY 8 bytes. A varbinary(8) is a binary that has upto 8 bytes. A null is 0 bytes. It has to be a form that can have 0 or 8 bytes. Thus it has to be varbinary.
二进制(8)是一个二进制文件,只有8个字节。 varbinary(8)是一个最多8个字节的二进制文件。 null是0字节。它必须是一个可以有0或8个字节的表单。因此它必须是varbinary。
#1
1
A binary(8) is a binary that has EXACTLY 8 bytes. A varbinary(8) is a binary that has upto 8 bytes. A null is 0 bytes. It has to be a form that can have 0 or 8 bytes. Thus it has to be varbinary.
二进制(8)是一个二进制文件,只有8个字节。 varbinary(8)是一个最多8个字节的二进制文件。 null是0字节。它必须是一个可以有0或8个字节的表单。因此它必须是varbinary。