Let\'s suppose we have a simple select query which return result like below
FirstName LastName PayScale
----------- --
You can write a query as:
DECLARE @employee TABLE (FirstName VARCHAR(100),
LastName VARCHAR(100),
PayScale INT)
INSERT INTO @employee VALUES
('Craig','L',150000) ,
('Alice,Lisa','simons',100000)
SELECT Split.a.value('.', 'VARCHAR(100)') AS FirstName , LastName ,PayScale
FROM (SELECT CAST ('' + REPLACE(FirstName, ',', ' ') + ' '
AS XML) AS FirstName , LastName ,PayScale
FROM @employee)
AS A
CROSS APPLY FirstName.nodes ('/M') AS Split(a)