Return type of it is an integer value.
Examples of LEN Function :
Example 1 : Use of LEN function in select clause
SELECT LEN('Syntax-Example')
Output
14
Above example returns number of characters in the specified string i.e. 14
Example 2 : Use of LEN function to display field length of table in a select clause
SELECT ContactName, LEN(ContactName) AS Length
FROM Customers
Output
ContactName Length
Maria Anders 12
Ana Trujillo 12
Antonio Moreno 14
Thomas Hardy 12
Christina Berglund 18
Hanna Moos 10
Above example displays length of customer name in customer table.
Example 3 : Use of LEN function in where clause
SELECT ProductName
FROM Products
WHERE LEN(ProductName) < 20
Output
Chai
Chang
Aniseed Syrup
Mishi Kobe Niku
Ikura
Queso Cabrales
Above example displays all customer name having length less than 20 characters.