Using SQLXML Bulk Load in .NET Environment - Error with One to Many relationship on Complex Type

Posted by user331111 on Stack Overflow See other posts from Stack Overflow or by user331111
Published on 2010-05-05T03:01:24Z Indexed on 2010/05/05 3:08 UTC
Read the original article Hit count: 453

Filed under:
|
|
|
|

Hi,

I have an error when I am importing an XML file using SQLXMLBulkLoad, wondering if anyone could help. Error: Data mapping to column 'Attribute' was already found in the data. Make sure that no two schema definitions map to the same column Full files and details can be found here http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_26102239.html

Exert from XSD: <sql:relationship name="EnvironmentDECAttributes" parent="Environment" parent-key="intEnvironmentID" child="DECAttributes" child-key="intEnvironmentID"/> <complexType name="Environment"> <sequence> <element name="ESANumber" minOccurs="0"> <annotation> <documentation> Environmentally Sensitive Area Number </documentation> </annotation> <simpleType> <restriction base="string"> <maxLength value="15"/> <whiteSpace value="collapse"/> </restriction> </simpleType> </element> <element name="Conditions" minOccurs="0" sql:relation="Conditions" sql:relationship="EnvironmentConditions"> <complexType> <sequence> <element name="Condition" type="vms:EnvironmentalConditions" minOccurs="0" maxOccurs="5"/> </sequence> </complexType> </element> <element name="DECDistrict" minOccurs="0"> <annotation> <documentation> Department of Environment &amp; Conservation District </documentation> </annotation> <simpleType> <restriction base="string"> <maxLength value="31"/> <whiteSpace value="collapse"/> </restriction> </simpleType> </element> <element name="DECAttributes" minOccurs="0" maxOccurs="1" sql:relation="DECAttributes" sql:relationship="EnvironmentDECAttributes"> <complexType> <sequence> <element name="Attribute" type="vms:DECAttributes" minOccurs="0" maxOccurs="unbounded" sql:field="Attribute"> <annotation> <documentation> Department of Environment &amp; Conservation attributes. </documentation> </annotation> </element> </sequence> </complexType> </element> </sequence> </complexType>

Exert from XML:

<Environment> <DECAttributes> <Attribute>WA</Attribute> <Attribute>SA</Attribute> </DECAttributes> </Environment>

Any help/ comments would be appreciated

Thanks

C

© Stack Overflow or respective owner

Related posts about sqlxml

Related posts about sql