Search string within string sql code example
Example 1: locate sql server
SELECT CHARINDEX('b','ab') //returns 2
Example 2: charindex
DECLARE @document VARCHAR(64);
SELECT @document = 'Reflectors are vital safety' +
' components of your bicycle.';
SELECT CHARINDEX('bicycle', @document);
GO