Welcome to San Francisco, Baghdad by the Bay

The blog, rants, ravings, and commentaries of Bill Watters

T-SQL to Split a varchar into Words

May 21st, 2008 · No Comments

It’s a user-defined-function to split a given string into ‘words’. In this case I’m delimiting words using commas and spaces. So ‘Smith, Fred’ (with a comma AND a space) will be separated into ‘Smith’ and ‘Fred’.
For convenience, it returns a table with a ‘pos’ column, representing the position in the original text that the word [...]

[Read more →]

Tags: Programming