Export (0) Print
Expand All
ABS
ALL
AND
ANY
AVG
bit
COS
COT
DAY
EXP
GO
IN
LEN
LOG
MAX
MIN
NOT
OR
PI
SET
SIN
STR
SUM
TAN
USE
VAR
Expand Minimize

LEN

SQL Server 2000

Returns the number of characters, rather than the number of bytes, of the given string expression, excluding trailing blanks.

Syntax

LEN ( string_expression )

Arguments

string_expression

Is the string expression to be evaluated.

Return Types

int

Examples

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

See Also

Data Types

String Functions

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft