SQL ServerDatabaseObtain the content length of the text field.What about it? This article introduces SQL
The server database obtains the content length of the text field throughDatalengthFunction. Next we will use the syntax of the datalength function and the example to learn about this part.
Datalength is used to return the number of bytes occupied by any expression.
Syntax: datalength (expression)
Parameter: ExpressionAny type of expression.
Return type: int
Note: datalength applies to varchar, varbinary, text, image, nvarchar, and ntext
Data types are especially useful because they can store variable-length data. The result of null datalength is null.
Returns the number of characters in a character expression. If the string contains leading and trailing spaces, the function will include them in the count. Len returns the same value for the same single-byte and double-byte strings.
Len(Character_expression ),String expression