May 2006
Intermediate to advanced
536 pages
15h 13m
English
This section demonstrates some of the aspects and challenges of working with character data. I’ll cover character-related problems, including pattern matching, parsing, and case sensitivity.
SQL Server has limited support for pattern matching through the LIKE predicate and PATINDEX function. There’s still no support for regular expressions in T-SQL. ANSI supports regular expressions through an operator called SIMILAR TO.
Regarding the optimization of LIKE expressions, to be able to use an index efficiently in SQL Server 2000 you had to use a constant at the beginning of the pattern–for example, LastName LIKE N′A%′. Note that the optimizer could decide to use an index even when the pattern started with a ...
Read now
Unlock full access