Returns the number of characters, rather than the number of bytes, of the given string expression, excluding trailing blanks.
LEN(string_expression)
int
This example selects the number of characters and the data in CompanyName for companies located in Finland.
USE Northwind
GO
SELECT LEN(CompanyName) AS 'Length', CompanyName
FROM Customers
WHERE Country = 'Finland'
Here is the result set.
Length CompanyName
----------- ------------------------------
14 Wartian Herkku
11 Wilman Kala
Data Types | String Functions |