Home > Archive > MS SQL XML > December 2005 > XML Bulk Load to Multiple Tables - Data for Child Key not imported to Tables









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author XML Bulk Load to Multiple Tables - Data for Child Key not imported to Tables
guxu@hotmail.com

2005-12-05, 8:25 pm

I have an annotated XML schema which defines the parent/child
relationship. I was trying to import the xml into SQL tables using XML
bulk load and the schema file. All the data went into the correct
tables just fine except for the key columns of the child tables (The
parent table gets the data for the key). Anybody knows what could
cause the problem?


My schema looks something like below:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xs:annotation>
<xs:appinfo>
<sql:relationship name="Child1_R" parent="Parent" parent-key="ID"
child="Child1" child-key="ID"/>
<sql:relationship name="Child2_R" parent="Parent" parent-key="ID"
child="Child2" child-key="ID"/>

</xs:appinfo>
</xs:annotation>

<xs:element name="Parent" sql:relation="Parent">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
........
<xs:element ref="Child1" sql:relationship="Child1_R"/>
<xs:element ref="Child2" sql:relationship="Child2_R"/>
</xs:sequence>
</xs:complexType>

</xs:element>
<xs:element name="Child1" sql:relation="Child1"
sql:relationship="Child1_R">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
.......
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:element>
<xs:element name="Child2" sql:relation="Child2"
sql:relationship="Child2_R">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
......
</xs:sequence>
</xs:complexType>
</xs:element>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com