Does anyone have a quick way of counting the number of times a pattern appears in a string e.g. I need to count the number of times the expression 'ab' appears in the string 'ab xxxxabxx ab'.
I know I can use patindex to get the first location & keep shortening the string everytime its found, however going through this for tables with a large number of rows is proving very time consuming.
I know I can use patindex to get the first location & keep shortening the string everytime its found, however going through this for tables with a large number of rows is proving very time consuming.