SQL Server CHARINDEX Function

Example

Search for “t” in string “Customer”, and return position:

SELECT CHARINDEX('t', 'Customer') AS MatchPosition;

Definition and Usage

The CHARINDEX() function searches for a substring in a string, and returns the position.

If the substring is not found, this function returns 0.

Note: This function performs a case-insensitive search. Continue reading SQL Server CHARINDEX Function