如何将XML文件转换为数据库?

时间:2021-07-15 21:46:59

I recently downloaded the SO Data Dump and was wondering how I could convert it from XML to a DB that I could use in my .NET applications.

我最近下载了SO数据转储,并想知道如何将它从XML转换为我可以在.NET应用程序中使用的数据库。

5 个解决方案

#1


Here's a wiki article describing the process of converting the XML data dump to a database by using stored procedures.

这是一篇wiki文章,描述了使用存储过程将XML数据转储转换为数据库的过程。

SQLServerPedia site contains many other articles related to SO -

SQLServerPedia站点包含许多与SO相关的文章 -

#2


You could try XML Bulk Load.

您可以尝试XML Bulk Load。

#3


you can convert it to DataSet using DataSet.ReadXml Method and that insert datatables to database

您可以使用DataSet.ReadXml方法将其转换为DataSet,并将数据表插入数据库

#4


C# handles XML natively very well. Unless there is a large amount of XML, simply use LINQ to XML.

C#本身可以很好地处理XML。除非有大量的XML,否则只需使用LINQ to XML。

If you have large amounts of XML, then handling it in streaming mode is proably less work than putting it in a DB

如果你有大量的XML,那么在流模式下处理它的工作量远远少于将它放在数据库中

#5


Hm, just use a XML parser, and make the database schema as you wish...you can also map the xml to a database directly... http://en.wikipedia.org/wiki/XML_database Do some more reading...really..

嗯,只需使用XML解析器,并根据需要制作数据库模式...您也可以直接将xml映射到数据库... http://en.wikipedia.org/wiki/XML_database做一些阅读。 ..真..

#1


Here's a wiki article describing the process of converting the XML data dump to a database by using stored procedures.

这是一篇wiki文章,描述了使用存储过程将XML数据转储转换为数据库的过程。

SQLServerPedia site contains many other articles related to SO -

SQLServerPedia站点包含许多与SO相关的文章 -

#2


You could try XML Bulk Load.

您可以尝试XML Bulk Load。

#3


you can convert it to DataSet using DataSet.ReadXml Method and that insert datatables to database

您可以使用DataSet.ReadXml方法将其转换为DataSet,并将数据表插入数据库

#4


C# handles XML natively very well. Unless there is a large amount of XML, simply use LINQ to XML.

C#本身可以很好地处理XML。除非有大量的XML,否则只需使用LINQ to XML。

If you have large amounts of XML, then handling it in streaming mode is proably less work than putting it in a DB

如果你有大量的XML,那么在流模式下处理它的工作量远远少于将它放在数据库中

#5


Hm, just use a XML parser, and make the database schema as you wish...you can also map the xml to a database directly... http://en.wikipedia.org/wiki/XML_database Do some more reading...really..

嗯,只需使用XML解析器,并根据需要制作数据库模式...您也可以直接将xml映射到数据库... http://en.wikipedia.org/wiki/XML_database做一些阅读。 ..真..