Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate SQL schema from XSD and load XML files into SQL Server

I have a XSD file and many XML data files. What's the fastest way to create the database/tables from the XSD file and then load all XML files into the generated database schema?

For now, I don't care if it's using a code generation tool or whatever else. I just want to know the fastest way to do this.

like image 439
Hamarict Avatar asked Oct 21 '22 20:10

Hamarict


1 Answers

Store the data as xml in the database:

  1. Create schema collection and create table: http://msdn.microsoft.com/en-us/library/ms176009.aspx
  2. Load xml into database: http://weblogs.sqlteam.com/mladenp/archive/2007/06/18/60235.aspx
  3. Query data: http://beyondrelational.com/modules/2/blogs/28/posts/10292/xml-workshops.aspx

Then you don't need to worry about having to create and maintain a load of tables.

like image 109
tom redfern Avatar answered Oct 27 '22 11:10

tom redfern