PATINDEX Missing ESCAPE Clause - by Victor Lindsey

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


9
0
Sign in
to vote
ID 259534 Comments
Status Closed Workarounds
Type Suggestion Repros 0
Opened 2/21/2007 8:13:18 PM
Access Restriction Public

Description

Unlike the LIKE and NOT LIKE expressions, PATINDEX cannot use the ESCAPE clause to form complex pattern expressions that involve use of some reserved wildcard characters.  For example "WHERE COL1 LIKE '%[()[\]{}<>]%' ESCAPE '\'" seems impossible to express within a PATINDEX function.
Sign in to post a comment.
Posted by PeterLRow on 2/1/2017 at 4:23 AM
Come on surely this is not that hard to add? The docs say it uses the same as the LIKE operator so why not make that 100% true instead of only partial true!
Just had the need to escape within a patindex and can't, :(
Posted by Stan Segers on 10/20/2008 at 8:27 AM
Extend the request to CHARINDEX too.
Posted by Srini [MSFT] on 5/30/2007 at 2:02 PM
Hi,
    Thanks for the feedback about PATINDEX functionality. We are in the process of looking through all possible enhancements for the future releases of SQL Server and we will conisder enhancing the PATINDEX to support escape clauses as part of these enhancements. Once again thanks for the feedback and it is very much appreciated.

-- srini acharya
Program Manager, Relational Engine