Approach to processing huge xml files in C #

Can someone help me solve this problem?

At my institution, we process huge xml files (max. 1 GB) and paste the details into a database table. In the current project, we analyze the xml file using the XmlReader and form the xml string with the required data, which will then be transferred to the stored procedure (xml data type) to insert the data into db.

Now the problem is that we are not sure if a different approach would be better than this? therefore, please suggest if there are any new features available with .Net 3.5 and / or SQL Server 2005 to handle this method better than our approach.

Any help on this reagrd would be greatly appreciated.

Thank.

+3
source share
3 answers

, XML ? , StreamReader XML .

XML, XmlReader.

1GB XML , XML? ? , - , .

, , / :

  • XML ?
  • ?
  • MemoryMappedFile?
  • - XML ?
+1

, - , , .

XML ? , , , , , .

0

xml ,

<rootNode>
    <row>...</row>
    <row>...</row>
    <row>...</row>
</rootNode>

IDataReader, xml ( XmlReader) , SqlBulkCopy. .

:

  • SqlBulkCopy
  • ,
  • it does not rely on a huge blob passing through the wire in an atomic way (necessary for the xml data type)
0
source

Source: https://habr.com/ru/post/1792458/


All Articles