level_zebra
level_zebra

Reputation: 1533

Reading an Xml document and inserting into a database

I have a xml document which contains customer information, I have to read this document and insert the relevant details into a database table.

Would it be better to parse the whole xml document and store the data in a container class and then add it to the database after the document has been read

Or after i have read the first customers data from the xml, add that record to the database, then read the next record from the xml file and so on

Upvotes: 0

Views: 143

Answers (1)

It depends on how much data you have in xml document.

If xml document is small it is better to use a container class, because when you read the data from the database, you can use the same container class.

If xml document is huge, use Bulk Insert.

Upvotes: 1

Related Questions