更新时间:2023-02-06 12:53:09
您可以为此目的使用binary
或varbinary
.
You could use eitherbinary
orvarbinary
for this purpose.
我建议varbinary
用于二进制字符串.这是将来版本中将支持的数据类型.
I''d suggest varbinary
for binary strings. This is the datatype that''s going to be supported in future versions.
binary(n)
用于固定长度的二进制数据,长度为varbinary(max)
,用于存储较大的二进制值(BLOB)binary(n)
变量存储n个字节的固定大小的二进制数据.它们最多可以存储8,000个字节varbinary(max)
变量存储大约n个字节的变长二进制数据.它们最多可以存储2 GB.
参考链接;- SQL Server中的二进制数据类型 [
binary(n)
for fixed-length binary data of length andvarbinary(max)
which is used to store large binary values (BLOBs)binary(n)
variables store n bytes of fixed-size binary data. They may store a maximum of 8,000 bytesvarbinary(max)
variables store variable-length binary data of approximately n bytes. They may store a maximum of 2 gigabytes.
Reference Link ;- Binary Data Types in SQL Server[^]