Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
返回表达式结果的基础存储的长度(以字节为单位)。
DATALENGTH( expression )
expression 通常是列的名称。如果 expression 是字符串常量,则必须将它用引号括起来。
UNSIGNED INT
DATALENGTH 函数的返回值如下:
SQL/2008 服务商扩充。
以下语句返回 CompanyName 列中最长字符串的长度。
SELECT MAX( DATALENGTH( CompanyName ) ) FROM Customers;
以下语句返回字符串 '8sdofinsv8s7a7s7gehe4h' 的长度:
SELECT DATALENGTH( '8sdofinsv8s7a7s7gehe4h' );