I created an application to send mail to users. I\'m using a database where some users have more than one email address assigned.
Name
Here's a simple example using the XML features in SQL Server 2005 and above. I've taken it verbatim from here but there are lots of examples if you google "split string sql server xml"
DECLARE @xml as xml,@str as varchar(100),@delimiter as varchar(10)
SET @str='A,B,C,D,E'
SET @delimiter =','
SET @xml = cast((''+replace(@str,@delimiter ,' ')+' ') as xml)
SELECT N.value('.', 'varchar(10)') as value FROM @xml.nodes('X') as T(N)
There are other solutions with cursors but this approach as worked well for me.