Importing XML into Multiple Tables

  • Quick questions, can you post an example of the XML and how big are the files?

    😎

  • I do not have an example of the xml to post, not allowed. The file is not large.

    It organizes perfectly except on the 5th table that I Need to omit. I do have a stored procedure that can access the file and place it into the 4 tables and it excludes the 5th but I do not believe that is the only way to do this it should be able to be processed in the manner that I am trying and there should be an option to exclude a node.

  • swoozie (11/25/2014)


    I do not have an example of the xml to post, not allowed. The file is not large.

    It organizes perfectly except on the 5th table that I Need to omit. I do have a stored procedure that can access the file and place it into the 4 tables and it excludes the 5th but I do not believe that is the only way to do this it should be able to be processed in the manner that I am trying and there should be an option to exclude a node.

    Best bet would be to review the generated XSD, suspect that's the culprit, those are normally not too clever.

    😎

  • I tried to do the following:

    1) remove the references to the extra table from the XSD = didnt work

    2) Change the name of the column in the XSD still tried not to import it = Did\didnt work (sort of worked)

    3) Changed the name of the column in the XSD and had it import into a table in the database = Worked

    could not find any other alternative.

  • swoozie (12/2/2014)


    I tried to do the following:

    1) remove the references to the extra table from the XSD = didnt work

    2) Change the name of the column in the XSD still tried not to import it = Did\didnt work (sort of worked)

    3) Changed the name of the column in the XSD and had it import into a table in the database = Worked

    could not find any other alternative.

    The thing is that although the XML structure can hold relational data in a structured format, it isn't always reverse-engineer-able, as an example, a human will know that there is only one home address related to a person, the xsd.exe will assume its a many to many relationship. This is why I discourage the use of such tools as I've never seen a satisfactory output apart from the simplest of schemas.

    On the other hand, if importing the arbitrary data and ignoring it is the solution then that's probably the path of the least resistance;-)

    😎

Viewing 5 posts - 1 through 6 (of 6 total)

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