left  license_enabled

Chapter 2: Transact-SQL Functions

len

Description

Returns the number of characters, not the number of bytes, of a specified string expression, excluding trailing blanks.

Syntax

len(string_expression)

Parameters

string_expression

is the string expression to be evaluated.

Examples

Example 1

Returns the characters

select len(notes) from titles
where title_id = "PC9999"
-----------
39

Usage

This function is the equivalent of char_length(string_expression).

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

Any user can execute len.

See also

Datatypes char, nchar, varchar, nvarchar

Functions char_length, left, str_replace





Copyright © 2005. Sybase Inc. All rights reserved. license_enabled

View this book as PDF