Steve Jones - Editor (8/26/2009)
Thanks, Hugo, for the practical applications. Didn't think about something like searching the newsgroups.
Yeah, I once had to write code to manipulate some strings that might contain one of each of these patterns: [1xxx
1], and [2xxx
2]. One condition determined whether the first pattern should be replaced by either xxx
, and another condition had a similar function for the second pattern. And both patterns can be present in a single string. Had loads of fun writing the LIKE and PATINDEX functions for that one!
Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis