Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
返回字符串中的字节数。
BYTE_LENGTH( string-expression )
string-expression 要计算其长度的字符串。
INT
返回的长度中包括 string-expression 中的尾随空格字符。
NULL 字符串的返回值为 NULL。
如果字符串使用的是多字节字符集,则 BYTE_LENGTH 值可能不同于 CHAR_LENGTH 返回的字符数。
此函数支持 NCHAR 输入和/或输出。
SQL/2008 服务商扩充。SQL/2008 标准中的等效函数是 OCTET_LENGTH 函数。
以下语句返回值 12。
SELECT BYTE_LENGTH( 'Test Message' );