The charindex feature is often used to search through character ranges in characters or strings.
assuming that the searched character includes a character search, then the function returns a nonzero integer that is the beginning of the character in the searched character. That is, the CHARINDEX function returns the starting position of a character or string in a string.
The CHARINDEX function calls methods such as the following:
CHARINDEX (expression1, expression2 [, Start_location])
Expression1 is the character to look for in expression2, Start_location is where the CHARINDEX function starts to find expression2 in expression1.
Example one:
Select CHARINDEX (' q1l ', ' Http://blog.csdn.net/jiankun ')
The results are as follows:
Example two:
Select CHARINDEX (' blog ', ' Http://blog.csdn.net/jiankun ')
The results are as follows:
SQL SERVER CHARINDEX Features