I am trying to load XML files into SQL server database using SQLXML4.0
I have relation defined as such:
<xs:annotation>
<xs:appinfo>
<sql:relationship name="ApplicantPhone"
parent="Applicant"
parent-key="PQNumber"
child="Phone"
child-key="PQNumber" />
</xs:appinfo>
</xs:annotation>
and then I am using the relations as follows:
<xs:element minOccurs="0" maxOccurs="unbounded" name="CustPhone" sql:relation="Phone" sql:relationship="ApplicantPhone">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Area" type="xs:string" sql:field="Area"/>
<xs:element minOccurs="1" maxOccurs="1" name="Exchange" type="xs:string" sql:field="Exchange"/>
<xs:element minOccurs="1" maxOccurs="1" name="Number" type="xs:string" sql:field="Number"/>
<xs:element minOccurs="0" maxOccurs="1" name="Extension" type="xs:string" sql:field="Extension"/>
</xs:sequence>
</xs:complexType>
</xs:element>
When I run my vbs script to import the XML I get the error:
Result State="FAILED"
HResult=0x80004005
Description=Schema: unknown attribute 'name' on relationship tag.
Source=Schema mapping
Type=FATAL
I would appreaciate your suggestion on fixing this issue.
Thanks