patindex

Returns an integer that represents the starting position of the first occurrence of "string_expression1" in the "string_expression2". Returns 0 if "string_expression1" is not found. The % wildcard character must precede and follow "string_expression1", except when searching for first or last characters.

Syntax

patindex ( string_expression1 , string_expression2 )

Example

patindex ( '%po%', 'Report' )

Result

3