CHARINDEX function

Function

The CHARINDEX function returns a 64 bit signed integer containing the position of the first occurrence of the specified string in a LONG VARCHAR column. CHARINDEX returns a 32 bit signed integer position for CHAR and VARCHAR columns.

Syntax

CHARINDEXstring-expression, long-varchar-column )

Parameters

string-expression The string for which you are searching. This string is limited to 255 bytes.

long-varchar-column The name of the LONG VARCHAR column.

Usage

See also

For a full description and an example of the CHARINDEX function, see “CHARINDEX function [String]” in Chapter 4, “SQL Functions” of Reference: Building Blocks, Tables, and Procedures.