i have a query that returns rows that i want, e.g.
QuestionID QuestionTitle UpVotes DownVotes
========== ============= ======= =========
2142075
I tried 3 approaches to this solution, the one posted here, activex scripting and UDF functions.
The most effective script (speed-wise) for me was bizzarely Axtive-X script running multiple queries to get the additioanl data to concat.
UDF took an average of 22 minutes to transform, the Subquery method (posted here) took around 5m and the activeX script took 4m30, much to my annoyance since this was the script I was hoping to ditch. I'll have to see if I can iron out a few more efficiencies elsewhere.
I think the extra 30s is used by the tempdb being used to store the data since my script requires an order by.
It should be noted that I am concatanating huge quantities of textual data.