position of occurance of the string in sql code example Example: locate sql server SELECT CHARINDEX('b','ab') //returns 2