Welcome to my .NET related blog!
DECLARE @ValueList NVARCHAR(MAX)
SELECT @ValueList = COALESCE( @ValueList + ', ' + ColumnAlias, ColumnAlias, @ValueList)
FROM MyTable
PRINT @ValueList
Thanks to Alex Norcliffe for this!
Post a Comment
No comments:
Post a Comment