sql server: select column values as comma separated string
snippet in sql

sql server: select column values as comma separated string

user2287

 DECLARE @SQL AS VARCHAR(8000)
SELECT @SQL = ISNULL(@SQL+',','') + ColumnName FROM TableName
SELECT @SQL