0

I have populated a new table and I need to aggregate a column without using the string_agg function as this is SQL Server 2008 (old data).

Looks something like this:

id      file       type        created 
---------------------------------------
1       xyz1.pdf     A           4/06
1       xyz2.pdf     A           4/06
1       xyz3.pdf     A           4/06
2       abc.pdf      A           4/06
2       abc1.pdf     A           4/06
3       123.pdf      A           4/06

I need this:

id      file                          type        created 
----------------------------------------------------------
1       xyz1.pdf;xyz2.pdf;xyz3.pdf      A           4/06
2       abc.pdf;abc1.pdf                A           4/06
3       123.pdf                         A           4/06

I'm pretty new to this so explicit instructions would be necessary

Thanks!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • A quick google shows that this question has been asked many many times before. Please do your research before asking us to spend our time assisting. – Dale K Dec 22 '20 at 19:40
  • 1
    SQL Server 2008 is, however, End of Life and has been for over a year. The *real* solution is upgrade to a supported version. Both the latest versions support `STRING_AGG`. – Thom A Dec 22 '20 at 20:07

0 Answers0