STRING_AGG aggregation result exceeded the limit of 8000 bytes error select c id , c bereichsname , STRING_AGG(j oberbereich,',') oberBereiches from stellenangebote_archiv as j join bereiche as c on j bereich_id = c id group by c id, c bereichsname But I am getting the following error: STRING_AGG aggregation result exceeded the limit of 8000 bytes Use LOB types to avoid result truncation
Get unique values using STRING_AGG in SQL Server Another possibility to get unique strings from STRING_AGG would be to perform these three steps after fetching the comma separated string: Split the string (STRING_SPLIT)