x

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.

more ▼

asked Dec 14, 2015 at 01:44 PM in Default

avatar image

Peter001
250 6

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.

Dec 29, 2015 at 05:36 PM Grant Fritchey ♦♦
(comments are locked)
10|1200 characters needed characters left

3 answers: sort voted first

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.

more ▼

answered Dec 15, 2015 at 04:46 PM

avatar image

Alvin Ramard
1.4k 2 5

(comments are locked)
10|1200 characters needed characters left

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.

more ▼

answered Dec 16, 2015 at 02:12 AM

avatar image

erlokeshsharma08
2k 3 12 16

(comments are locked)
10|1200 characters needed characters left

SSIS cannot automatically adjust for XML files for which the structure changes.

more ▼

answered Dec 16, 2015 at 02:54 PM

avatar image

Alvin Ramard
1.4k 2 5

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1212
x202
x66

asked: Dec 14, 2015 at 01:44 PM

Seen: 119 times

Last Updated: Jan 03, 2016 at 04:08 AM

Copyright 2017 Redgate Software. Privacy Policy