Wednesday, March 28, 2012

Mapping multiple elements to the same table

I have a huge 1+GB xml file that I'd like to bulk load into a single staging
table in SQL Server. The xml file has subelements that need to be loaded
into the same table as the parent element. For example:
<Customer>
<Address>
</Address>
<ContactInfo>
</ContactInfo>
</Customer>
I cannot seem to get an XSD that will load all the data into 1 table. Also
because of the size of the XML file, performing an XSLT transformation on the
file is not possible. What are my options? Is it possible to map
subelements to the same table as the containing element?
Could you map them to two different views of the same table?
Note also, that the mapping kind of expects that you give a relationship
annotation when you map parents and children. What is the error message or
behaviour that you are getting?
Best regards
Michael
"Mark Weber" <Mark Weber@.discussions.microsoft.com> wrote in message
news:14D8B400-733C-4080-8888-BD3551C6AD09@.microsoft.com...
>I have a huge 1+GB xml file that I'd like to bulk load into a single
>staging
> table in SQL Server. The xml file has subelements that need to be loaded
> into the same table as the parent element. For example:
> <Customer>
> <Address>
> </Address>
> <ContactInfo>
> </ContactInfo>
> </Customer>
> I cannot seem to get an XSD that will load all the data into 1 table.
> Also
> because of the size of the XML file, performing an XSLT transformation on
> the
> file is not possible. What are my options? Is it possible to map
> subelements to the same table as the containing element?

No comments:

Post a Comment