Just because I love options one other way you could do this is with a cte I haven't seen it done this way but it makes sense to me. As a side not I don't have sql server with me if you run into max recursion you might have to add 1 to the start of the substring in the second all names case/
with recCTE as (
select id,substring(allNames,0,charindex(',',allNames)) name,substring(allNames,charindex(',',allNames),len(allNames)-charindex(',',allNames)) allNames
from yourTable
union all
select id,
case when charindex(',',allNames) >0 then
substring(allNames,0,charindex(',',allNames)) name
else
allNames name
end
,case when charindex(',',allNames) >0 then
substring(allNames,charindex(',',allNames),len(allNames)-charindex(',',allNames)) allNames
else
''
end
from recCTE
where allNames <> ''
)
select id,name
from recCTE