Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Writing  large xml file -  memory issue

Posted on 2011-03-13
3
Medium Priority
?
518 Views
Last Modified: 2012-05-11
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
Comment
Question by:duke63
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 35126592
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
 

Author Comment

by:duke63
ID: 35126818
OK, I'll give it a try. Think xmlwriter.flush is what I need.
0
 

Author Comment

by:duke63
ID: 35128971
Works great and fast, thanks!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question