मुझे लगता है कि यह ऐसा करेगा:
SELECT parent_id AS ID,
STUFF((
SELECT ','+color FROM TableB a WHERE a.parent_id = b.parent_id FOR XML PATH('')
),1,1,'') AS color,
STUFF((
SELECT ','+Location FROM TableB a WHERE a.parent_id = b.parent_id FOR XML PATH('')
),1,1,'') AS Location,
FROM TableB b
GROUP BY parent_id