question

Peter001 avatar image
Peter001 asked

Dynamic Table Creation based on Document Type Definition of XML

I have an XML document (1 GB in size) with a Document Type Definition. I need to load the data into an sql table, but the challenge is the table structure must be created during runtime, and it depends upon the .dtd file. The .dtd file changes from customer to customer. I am new to XML. I can provide the XML and .dtd if its required. Thanks a ton.
ssisxmlpowershell
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
You have some good answers below. This web site runs by you voting and marking the best answers. For each helpful answer below, indicate this by clicking on the thumbs up symbol next to those answers. If any one answer lead to a solution, indicate this by clicking on the check mark next to that answer. This helps indicate your solution for anyone else with the same question.
0 Likes 0 ·
Alvin Ramard avatar image
Alvin Ramard answered
There is no simple, magic, way to do this. In order to accomplish what you're after, you need to understand the dtd files and how they relate to the required SQL table(s). Only after you have a reasonable grasp on this can you expect to generate tables on the fly from your document.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

erlokeshsharma08 avatar image
erlokeshsharma08 answered
From ssis perspective you could try using - xml source, xml task and if they dont do justice , a script component/task to write your customized code. Please attach the xml and dtd files is possible.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Alvin Ramard avatar image
Alvin Ramard answered
SSIS cannot automatically adjust for XML files for which the structure changes.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.