Relatively hard to do in SQL if you want fairly broad delimiters - such as "Any non alphabetic character". A list which is delimited by, say, "comma" is easy (i.e. where the list and delimiter are consistent). Widen that to "Split all words" where the delimiter then starts to become "A space, hyphen, slash, ..." and "ignoring all other punctuation" is difficult. The other problem is where you have a double-space between words - you could easily take care of that in VB, but its a pain to handle in SQL - without careful handling a double-space (I'll use "." to illustrate the spaces) such as
WORD1..WORD2 will mean that the 2nd word is "blank" and the 3rd word is "WORD2"
Sure, you can do it like VB walking through the string character-by-character, but that's a really bad way to build a SQL function which is then applied to multiple rows
There are a number of ways to tackle this, I'll be interested in what others have to say, but I would use a string splitter function (which will split the
@Phrase into a pseudo-table, one row per word, and then just add
WHERE SplitItemNo = 2
A String Splitter Function is very useful in SQL (there isn't one built in until SQL 2016, and that one has severe limitations), and as you are likely to reuse it generically its worth installing one that is efficient such as Jeff Moden's function called DelimitedSplit8K
Where we want a free-word search on a text field - e.g. a Product Name where we want Customers to be able to find products by any word in the Product Name - we split the product name into individual words, put them in a Keyword table, and then search the Keyword table (which is very fast) for the "Product Find" function.
I wrote a detailed description of that for someone the other day, so if it turns out that is the type of problem you are trying to solve let me know and I'll get a link.