[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 521
  • Last Modified:

Writing large xml file - memory issue

I have a large datatable in sql server 2000 with xml code for each row in ntext field.
(about 500000 rows) My normal strategy is to loop through the rows in batch sizes and add the xml elements to a xmldocument in memory and then do xmldocument.save.
In this case it runs out of ram.
Any suggestions how to split this process?
0
duke63
Asked:
duke63
  • 2
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
I think you are going to need to resort to using an XmlWriter, rather than an XmlDocument. This should help you get started:

    http://msdn.microsoft.com/en-us/library/wkee9k2s(v=vs.71).aspx

   
0
 
duke63Author Commented:
OK, I'll give it a try. Think xmlwriter.flush is what I need.
0
 
duke63Author Commented:
Works great and fast, thanks!!
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now