LEN (Transact-SQL)
SQL Server 2012
Returns the number of characters of the specified string expression, excluding trailing blanks.
Note
|
|---|
|
To return the number of bytes used to represent an expression, use the DATALENGTH function. |
bigint if expression is of the varchar(max), nvarchar(max) or varbinary(max) data types; otherwise, int.
If you are using SC collations, the returned integer value counts UTF-16 surrogate pairs as a single character. For more information, see Collation and Unicode Support.
Note