In this post explains how to use the CHARINDEX function in SQL Server (Transact-SQL) with syntax and examples.
In SQL Server (Transact-SQL), the CHARINDEX functions returns the location of a substring in a string. The search is NOT case-sensitive.
The syntax for the CHARINDEX function in SQL Server (Transact-SQL) is:
The substring that you want to find.
The string to search within.
Optional. The position in string where the search will start. The first position is 1.
The CHARINDEX function can be used in the following versions of SQL Server (Transact-SQL):
Let's look at some SQL Server CHARINDEX function examples and explore how to use the CHARINDEX function in SQL Server (Transact-SQL).
For example: