First, you need to normalize your data so that you don't have this problem anymore.Second, if the number of values does not exceed 4, then you can use the PARSENAME function. Example to follow. If the number of values exceeds 4, then you can use this:http://www.sqlteam.com/item.asp?ItemID=2652CREATE TABLE Table1 (Column1 int, Column2 varchar(50))INSERT INTO Table1 VALUES(1, 'Tara,Mike')INSERT INTO Table1 VALUES(2, 'Alex,Rebecca,Zach')GOCREATE VIEW View1ASSELECT Column1, PARSENAME(REPLACE(Column2, ',', '.'), 1) as Part1, PARSENAME(REPLACE(Column2, ',', '.'), 2) as Part2, PARSENAME(REPLACE(Column2, ',', '.'), 3) as Part3, PARSENAME(REPLACE(Column2, ',', '.'), 4) as Part4FROM Table1GOSELECT Column1, Part1FROM View1WHERE Part1 IS NOT NULLUNION ALLSELECT Column1, Part2FROM View1WHERE Part2 IS NOT NULLUNION ALLSELECT Column1, Part3FROM View1WHERE Part3 IS NOT NULLUNION ALLSELECT Column1, Part4FROM View1WHERE Part4 IS NOT NULLORDER BY 1, 2DROP VIEW View1DROP TABLE Table1
Tara