SQL Charindex

From Logic Wiki
Jump to: navigation, search

Searches an expression for another expression and returns its starting position if found.

Syntax

CHARINDEX ( expressionToFind ,expressionToSearch [ , start_location ] )

Arguments

expressionToFind

Is a character expression that contains the sequence to be found. expressionToFind is limited to 8000 characters.

expressionToSearch

Is a character expression to be searched.

start_location

Is an integer or bigint expression at which the search starts. If start_location is not specified, is a negative number, or is 0, the search starts at the beginning of expressionToSearch.