You need to specify relationships if a child element maps to different than
table. Check out this link for full list of annotations and their usage:
http://msdn.microsoft.com/library/de...nch_SQLXML.asp
--
Bertan ARI
This posting is provided "AS IS" with no warranties, and confers no rights.
<forest95@hotmail.com> wrote in message
news:1115069201.845833.265830@f14g2000cwb.googlegroups.com...
> I am attempting to import an XML file into SQL Server 2000 using the
> SQLXML Bulk Load functionality. I have written a DTS Package which
> takes an .XML file and .XSD file which I have annotated. I have one
> database table I'm using to import the data but I get the following
> error:
>
> Schema: relationship expected on 'Task'
>
>
> Here is a snippet of the .XSD:
>
>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
> <!--
>
****************************************************************************
**
> -->
> <!-- Parent Tree -->
> <xsd:element name="TaskData" type="TaskDataType"
> sql:relation="tbl_XML_Data"/>
> <!--
>
****************************************************************************
**
> -->
> <!-- Define Data Type TaskDataType -->
> <xsd:complexType name="TaskDataType">
> <xsd:sequence>
> <xsd:element name="Task" maxOccurs="unbounded">
> <xsd:complexType>
> <xsd:complexContent>
> <xsd:extension base="TaskType"/>
> </xsd:complexContent>
> </xsd:complexType>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> <!--
>
****************************************************************************
**
> -->
> <!-- Define Data Type TaskType -->
> <xsd:complexType name="TaskType">
> <xsd:sequence>
> <xsd:element name="RecordNumber" type="xsdositiveInteger"
> sql:field="RecordNumber"/>
> <xsd:element name="ContractNumber" sql:field="ContractNumber">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:minLength value="6"/>
> <xsd:maxLength value="13"/>
> <xsdattern value="[^'"]*"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:element>
>


LinkBack URL
About LinkBacks
ositiveInteger"