Link to home
Start Free TrialLog in
Avatar of Craig Beamson
Craig BeamsonFlag for United Kingdom of Great Britain and Northern Ireland

asked on

CLR "save to file" procedure erroring in SQL Server 2005 SP3

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.
System.Threading.ThreadAbortException: Thread was being aborted.
System.Threading.ThreadAbortException:
   at System.Data.SqlTypes.SqlChars.get_Value()
   at System.Data.SqlServer.Internal.XvarWlobStream.GetCharArray()
   at System.Data.SqlServer.Internal.XvarWlobStream.GetString()



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?
ASKER CERTIFIED SOLUTION
Avatar of Mark Wills
Mark Wills
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial