DECLARE @result varchar(MAX)
SELECT
NAME
FROM
Table
WHERE
ID = @Id
I need to fill @result with result Names, separated by ','.
For example, if SELECT returns 'A','B' and 'C', the @result should be 'A, B, C'.
It is Microsoft SQL Server 2008.