Shaishav7
Shaishav7

Reputation: 139

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.

If it is possible to create a new table every time then how it is possible? If not, then why?

Upvotes: 2

Views: 459

Answers (1)

RThomas
RThomas

Reputation: 10880

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. This link has a complete walkthrough.

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."

Upvotes: 1

Related Questions