I'm using a CLR procedure (which I've called "writetofile") to allow SQL server to generate xml and save to file. The procedure is based on the code at http://www.sqldbatips.com/showarticle.asp?ID=23
I'm using the procedure in a query which produces about 20 lines of XML per record retrieved and then saves the XML document to file. The query works fine if I initially select the top 1,000 records (to produce around 20,000 lines of XML) but errors on around 10,000 records or more. My results need to include around 60,000 records. The query errors with the following error message:
Msg 6532, Level 16, State 49, Procedure writetofile, Line 0
.NET Framework execution was aborted by escalation policy because of out of memory.
n: Thread was being aborted.
I've found a hotfix which looks relevant to this but cannot install it as I have SP3 and it is designed for SP1. See the following link for details of the hotfix: http://support.microsoft.com/kb/928083
I've downloaded the Hotfix (several distinct executables which need to be installed in order).
When it comes to installing the hotfix, I'm falling at the first hurdle - when I run the first executable, it advises that is designed for SP1 and my version of Sql Server 2005 is at SP3. It suggests I download a version of the hotfix for SP3. - which I cannot locate.
Any ideas for how I'd get some solution to leave me able to write a large amount of text (XML) to file as part of a SQL procedure?