Returns the number of characters of the specified string expression, excluding trailing blanks.
Transact-SQL Syntax Conventions
LEN ( string_expression )
Is the string expression to be evaluated.
bigint if expression is of the varchar(max), nvarchar(max) or varbinary(max) data types; otherwise, int.
The following example selects the number of characters and the data in FirstName for people located in Australia.
FirstName
Australia
USE AdventureWorks; GO SELECT LEN(FirstName) AS Length, FirstName, LastName FROM Sales.vIndividualCustomer WHERE CountryRegionName = 'Australia'; GO