简体   繁体   English

Xml到SQL Server 2008

[英]Xml to SQL Server 2008

Is it possible to create SQL tables every time I read XML files OR to implement this we must have a pre-designed table and just to add fields in the available tables. 每次读取XML文件时是否都可以创建SQL表,或者要实现此目的,我们必须有一个预先设计的表并仅在可用表中添加字段。

If it is possible to create a new table every time then how it is possible? 如果可以每次创建一个新表,那怎么可能呢? If not, then why? 如果没有,那为什么呢?

With the tools you've identified there is no reason that you cannot create SQL tables on the fly from an XML file using a DataAdapter - as long as you've defined the Schema properly in the XML. 使用已经确定的工具,没有理由不能使用DataAdapter从XML文件快速创建SQL表-只要您已在XML中正确定义了Schema。 This link has a complete walkthrough. 此链接具有完整的演练。

http://www.codeproject.com/KB/cpp/dataset.aspx http://www.codeproject.com/KB/cpp/dataset.aspx

Halfway through the article search for the header titled "Updating the Database". 在文章中途搜索标题为“更新数据库”的标题。 And note the following quote: "If your XML file contains any schema information then the DataSet will detect and create the corresponding tables and enable any constraints automatically." 并注意以下引号: “如果您的XML文件包含任何架构信息,则DataSet将检测并创建相应的表并自动启用任何约束。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM