Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

Returns the starting position of the first occurrence of a pattern in a specified expression, or zeros if the pattern is not found, on all valid text and character data types.

PATINDEX ( '%pattern%', expression )


A literal string. Wildcard characters can be used; however, the % character must precede and follow the pattern (except when searching for first or last characters). The pattern argument is an expression of types that can be implicitly converted to nchar, nvarchar, or ntext.


An expression, usually a column that is searched to find the specified pattern. The expressionargument can be nchar, nvarchar, or ntext.


The following example searches the list of products that have the word "Anton" in their name.

SELECT ProductName, PATINDEX('%Anton%', ProductName)
FROM Products
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft