WildCard search using PATINDEX

Bandi
Posted by Bandi under Sql Server category on | Points: 40 | Views : 273
PATINDEX string function is used to find out the starting position of first occurance of a pattern in a given stering/expression.

Syntax:

PATINDEX ( '%pattern%' , expression )


Example: Here we are searching for a pattern wild%search
SELECT PATINDEX('%wild%search%', 'CHARINDEX does not support wild card characters to search for pattens') FindPostitionOfWildCardSearch


OutPut:
FindPostitionOfWildCardSearch
28

Comments or Responses

Login to post response