Possible Duplicate:
Split string in SQL
I have seen a couple of questions related to string concatenation in SQL. I wonder how would you approach the opposite problem: splitting coma delimited string into rows of data:
Lets say I have tables:
userTypedTags(userID,commaSeparatedTags) 'one entry per user
tags(tagID,name)
And want to insert data into table
userTag(userID,tagID) 'multiple entries per user
Inspired by Which tags are not in the database? question
EDIT
Thanks for the answers, actually more then one deserves to be accepted but I can only pick one, and the solution presented by Cade Roux with recursions seems pretty clean to me. It works on SQL Server 2005 and above.
For earlier version of SQL Server the solution provided by miies can be used. For working with text data type wcm answer will be helpful. Thanks again.