为什么 SQL 服务器图像数据类型 max_length 在 sys.all_columns 中设置为 16
Why does SQL Server Image data type have max_length set to 16 in sys.all_columns
通过SYS.all_columns检查SQL服务器中的列定义时,我发现图像数据类型max_length设置为16。谁能帮忙解释一下这是什么意思?
你看到的16不是指data的最大大小,而是指pointer的大小LOB 值(默认情况下存储在行外)。
documentation for sys.columns
mentions the 16 bytes, but does a poor job of explaining why (and it only says it applies to text
but in fact it applies to text
, ntext
, and image
). I recently submitted a PR to make this more clear, and it was approved(应该在下周左右发布)。
the TEXTPTR
topic 上有一个更好的小信息块,其中一个示例说:
returns the 16-byte text pointer
请注意,自从 SQL Server 2005 发布超过 16 年以来,documentation for image
就出现了此警告:
IMPORTANT! ntext, text, and image data types will be removed in a future version of SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead.
几个月前我也在博客上写过这个:
通过SYS.all_columns检查SQL服务器中的列定义时,我发现图像数据类型max_length设置为16。谁能帮忙解释一下这是什么意思?
你看到的16不是指data的最大大小,而是指pointer的大小LOB 值(默认情况下存储在行外)。
documentation for sys.columns
mentions the 16 bytes, but does a poor job of explaining why (and it only says it applies to text
but in fact it applies to text
, ntext
, and image
). I recently submitted a PR to make this more clear, and it was approved(应该在下周左右发布)。
the TEXTPTR
topic 上有一个更好的小信息块,其中一个示例说:
returns the 16-byte text pointer
请注意,自从 SQL Server 2005 发布超过 16 年以来,documentation for image
就出现了此警告:
IMPORTANT! ntext, text, and image data types will be removed in a future version of SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead.
几个月前我也在博客上写过这个: