xml to relational tables

  •  

    I need to insert xml documents into multiple relational tables in sql server. What is the easiest way to map the xml to the relevant tables. It was my intention to bring the document into a stored procedure as a string and use openxml to insert into the tables.  I have since heard xmlspy can automatically do this. Is this true? If so is there any other way of doing this?

     

    Thanks

    Danny

  • XmlSpy can create a xsd schema from a database structure and can also export database data to xml. I use XmlSpy quite a bit though and I don't know of a way to use it to import xml data into a database.

    The only method I would recommend of importing xml, other than your first thought of using SQL and OPENXML, is using SQLXML bulk loading. This requires a reasonable knowledge of schemas however but does perform an order of magnitude faster. It also handles the propagation of surrogate keys in related tables which is especially useful in deeply structured xml.

    Hope this helps

    Hope this helps

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply