0

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

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by n2201
0

I figured out. I was not using the correct table name in the relation. The error message sucks :-(

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.