Here is a small SQL script which allows you to concatenate the values from all rows into a single row/value.
SELECT T.value + ',' AS [text()]
FROM myTable T
FOR XML PATH ('')
Previously I was doing that using a variable, something like this:
DECLARE @var NVARCHAR(MAX)SET @var = ''
SELECT @var = @var + T.value + ','FROM myTable T
But why doing it so if there is a simpler way.