The SQL Server database uses the DATALENGTH function to obtain the content length of the TEXT field. Next, let's take a look at this part through the syntax of the DATALENGTH function and the example.
DATALENGTH is used to return the number of bytes occupied by any expression.
Syntax: DATALENGTH (expression)
Parameter: expression, an expression of any type.
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), a string expression