The powers that be have now decided they only need the first 300 characters from the XML-based code I'm currently using.
I've left the code as-is and I'm using
to get the bit I need.
Is there any way of restricting the code below to just return 300 characters (hopefully it will speed things up as well):-
Response + ','
and mult2.[Query]='Additional Notes'
for xml path ('')),'
',''),'&','&'),char(13),''),char(10),'') as Comments
,mult1.AbstractID) [Additional Notes]
It doesn't take too long (about 20 minutes) to sort out just over 1,000,000 records (there are quite a few joins) but a saving is a saving.
I've already enquired about adding indexes (there aren't any :angry
and that should speed things up as well.
I can't add the indexes directly as this is a third-part app that writes to a SQL database.
Any pointers gratefully received).
As an aside, I don't quite understand how the FOR XML PATH thing works and the link didn't really explain it (nor does any site I've found courtesy of Google). Would someone kindly explain?