FOR XML PATH versus STRING_AGG

I found a resolution for this issue. You should still move to STRING_AGG as soon as you get on SQL 2017 or above.

Edit the query with the issue, go to Actions\Execution Settings. In the dialog that pops up you can add a new setting called QueryOldCompanySecurity with any value (I used “True”). Make sure to set the Persist in Query flag. Hit OK, and save the query. I had a tiny bit of trouble with this UI, just don’t go back into the Query Execution Settings UI and click OK (you can click CANCEL).

I would love to hear if this solves your problem.

4 Likes