I have a unique situation. I am going to be grabbing various XML documents from another website run by www.sec.gov
. I have already built the code to find the paths of each file I need to them import into my SQL database. Here is the issue, the XML documents has a high level tags for <ownershipdocument> then there are various that need to be put in for each record. Then the document can have multiple tags with <DerivativeTable> and <NonDerivativeTable>. Some of the subtags share the same tag names under the higher level tags.
What I want to do is for each of these documents to create multiple records in my SQL Table with the individual names, addresses and document type then just one of the sections for the <derivativeTable> and <NonDerivativeTable>. So the insert would be like this:
Person, address, document type, nonderivativeSection1
Person, address, document type, nonderivativeSection2
Person, address, document type, DerivativeSection1
Person, address, document type, DerivativeSection2
Person, address, document type, DerivativeSection3
I am integrating this into an ASP page using VBScript so that once I have provided the links that need to be imported, it would read through them all and when finished, the original set of links in the tempDB would be removed. Here is a sample of the XML file that I will be pulling from ftp://ftp.sec.gov/edgar/data/99302/0000891839-04-000128.txt
. If you notice in the <nonDerivativeTable> there is only one section of <nonDerivativeHolding>. In the <derivativeTable> there are 3 sections of <derivativeHolding>. What I would need is for the NonDerivativeHolding and the 3 DereivativeHolding sections to create a seperate record in the SQL table with all of the data above the NON seciton repeated.