SQL Server > Built-in Functions > CHARINDEX
CHARINDEX SQL Server function searches an expression for another expression and returns its starting position if found.
Example
CHARINDEX SQL Server function searches an expression for another expression and returns its starting position if found.
Example
declare @t nvarchar(max)
set @t = 'blue; red; green'SELECT CHARINDEX(';', @t);
Result
(No column name)
SELECT CHARINDEX(':', @t);
(No column name)