January 14, 2011 at 2:12 pm
Comments posted to this topic are about the item CLR Aggregate to Concatenate delimited strings
January 27, 2011 at 7:35 am
wouldn't
declare @result varchar(max);
select @result = coalesce(@result + ',' + value,value) from @codes;
select @result;
be a lot simpler?
May 17, 2011 at 7:43 pm
david.wright-948385 (1/27/2011)
wouldn't
declare @result varchar(max);
select @result = coalesce(@result + ',' + value,value) from @codes;
select @result;
be a lot simpler?
I agree your T-SQL solution is simpler than the example code used to demonstrate how the CLR function works, however your T-SQL solution does not bring anything to GROUP BY queries where groups are being processed because COALESCE is not an aggregate function like the CLR function.
Here is a project containing several CLR User-Defined Aggregate functions that offer similar functionality to the function in the article but that will greatly outperform the function in the article for large datasets:
http://groupconcat.codeplex.com
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
May 17, 2016 at 7:03 am
Thanks for the script.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply