Takes one argument as an input of type BINARY or STRING and returns the number of characters, as defined by the database's collation sequence, of a specified string expression, excluding trailing blanks. The result may differ from the string’s byte length for multi-byte character sets.
BINARY and VARBINARY are also allowed, in which case LEN() returns the number of bytes of the input.
LEN is an alias of LENGTH function
LEN ( string_expr )
string_expr is the string expression to be evaluated.
The following example returns the value 3152:
select len(Photo) from Productswhere ID = 500
This function is the equivalent of CHAR_LENGTH ( string_expression ).
Any user can execute LEN.
ANSI SQL – Compliance level: Transact-SQL extension
Data types CHAR, NCHAR, VARCHAR, NVARCHAR.
See Chapter 3, “SQL Data Types.”
Functions “CHAR_LENGTH function [String]” and “STR_REPLACE function [String]”.
For general information about string functions, see “String functions”.