charindex function in sql server with examples Example: locate sql server SELECT CHARINDEX('b','ab') //returns 2