Isaac
Lifelong Learner
- Local time
- Yesterday, 21:15
- Joined
- Mar 14, 2017
- Messages
- 10,096
This post is mostly intended for people who are familiar with the 2 methods I'm talking about - as opposed to me having to provide a bunch of DDL that you can replicate or sample data - I mean that in the most respectful way but I think there will be those who know what I'm talking about without me taking the time to elaborate by providing sample data so am trying to save time
Okay ::
I have a lot of older code that uses the old method of a combination of STUFF and FOR XML in order to return data like value,value,value
I could convert this to a combination of Outer Apply and String_Agg (or a String_Agg directly inside a subquery on the Select list), but is there any inherent value likely to be gained from this? I know to a large extent "it depends", but assuming all else is equal - is there some intrinsic value like string_agg is going to be a lot faster or something? As far as we know ?
Okay ::
I have a lot of older code that uses the old method of a combination of STUFF and FOR XML in order to return data like value,value,value
I could convert this to a combination of Outer Apply and String_Agg (or a String_Agg directly inside a subquery on the Select list), but is there any inherent value likely to be gained from this? I know to a large extent "it depends", but assuming all else is equal - is there some intrinsic value like string_agg is going to be a lot faster or something? As far as we know ?