SDU Tools: Extract Trimmed Words from T-SQL Strings
Occasionally I’ve needed to take a string, and extract all the words out of it. For example a string like ‘hello there greg’ might lead me to want the three words ‘hello’, ’there’, and ‘greg’. Note that I usually want them trimmed, not just extracted.
In our free SDU Tools for developers and DBAs, we added a table-valued function ExtractTrimmedWords to help with this. You can pass it a string, and it will pull it apart for you, assuming that you have whitespace separating the words.
2018-08-15