DECLARE @Table1 TABLE(ID INT, Value INT)
INSERT INTO @Table1 VALUES (1,100),(1,200),(1,300),(1,400)
SELECT ID
,STUFF((SELECT ', ' + CAST(Value AS VARCHAR(10)) [text()]
FROM @Table1
WHERE ID = t.ID
FOR XML PATH(''), TYPE)
.value('.','NVARCHAR(MAX)'),1,1,' ') List_Output
FROM @Table1 t
GROUP BY ID
SELECT STUFF(( SELECT ',' + Lure
FROM ( SELECT DISTINCT
Lure
FROM #LureNames
) x
FOR
XML PATH('')
), 1, 1, '') AllLures
STUFF(string, start, length, new_string)
SELECT STUFF('SQL Tutorial', 1, 5, 'HTML');
-- output
-- HTMLutorial