Home > Database > Mysql Tutorial > body text

MSSQL数据库获取TEXT字段的内容长度

WBOY
Release: 2016-06-07 17:54:57
Original
993 people have browsed it

SQL Server数据库如何获取TEXT字段的内容长度呢?本文我们就来介绍一下

SQL Server数据库如何获取TEXT字段的内容长度的方法,是通过DATALENGTH函数来实现的,接下来我们就通过DATALENGTH函数的语法及使用实例来了解一下这部分内容。

DATALENGTH用来返回任何表达式所占用的字节数。

语法:DATALENGTH ( expression )

参数:expression,任何类型的表达式。

返回类型:int

注释:DATALENGTH 对 varchar、varbinary、text、image、nvarchar 和 ntext
数据类型特别有用,因为这些数据类型可以存储可变长度数据。NULL 的DATALENGTH 的结果是 NULL

--------------------------------------------------------------------------------

返回字符表达式中的字符数。如果字符串中包含前导空格和尾随空格,则函数会将它们包含在计数内。LEN 对相同的单字节和双字节字符串返回相同的值。

LEN(character_expression),字符串类型的表达式

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!