RE: SQLXMLBulkLoad - relationship error
- From: Monica Frintu [MSFT] <MonicaFrintuMSFT@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 4 Oct 2006 12:13:02 -0700
Hello,
You have to use sql:datatype annotation like this :
sql:datatype="varchar(10)" .
Best regards,
--
Monica Frintu
"Trillium" wrote:
I am using SQLXMLBulkLoad 3 to insert data into SQL Server 2000 database. I.
have SchemaGen and SGDropTables both true, so the tables are dropped and
created for the new data. Everything works fine except for one relationship
that causes an error. When I comment this relationship out of the schema,
the upload works perfectly - except of course that the inserted data cannot
be related because the item is not included.
The relationship in question includes a varchar(10) field (all the rest are
integers). The parent table is created and loads correctly. However the
child table is created as a varchar(1), and errors out as too small for the
values. Is there some problem with varchar relationships?
Here are the 2 fields from the tables created in the database:
From the parent table:
[RecordType] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
From the child table:
[RecordType] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
Here is a snippet of the XSD showing element and annotations in question:
<!-- ... -->
<xsd:element name="ParentTable" sql:relation="tblUpldParentTable">
<xsd:annotation>
<xsd:appinfo>
<sql:relationship parent="tblUpldOrganization" parent-key="OrganizationId"
child="tblUpldParentTable" child-key="OrganizationId" />
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ChildTable" sql:relation="tblUpldChildTable">
<xsd:annotation>
<xsd:appinfo>
<sql:relationship parent="tblUpldParentTable" parent-key="OrganizationId
FiscalYear RecordType" child="tblUpldChildTable" child-key="OrganizationId
FiscalYear RecordType" />
</xsd:appinfo>
</xsd:annotation>
...
<!-- ... from the ParentTable element attributes: -->
<xsd:attribute name="FiscalYear" type="xsd:integer" sql:field="FiscalYear"
sql:RecordType="bigint" />
<xsd:attribute name="RecordType" type="xsd:string" sql:field="RecordType"
sql:RecordType="varchar(10)" />
</xsd:complexType>
</xsd:element><!--ParentTable-->
- Follow-Ups:
- RE: SQLXMLBulkLoad - relationship error
- From: Trillium
- RE: SQLXMLBulkLoad - relationship error
- Prev by Date: SQLXMLBulkLoad & Stream
- Next by Date: Re: SQLXMLBulkLoad & Stream
- Previous by thread: SQLXMLBulkLoad & Stream
- Next by thread: RE: SQLXMLBulkLoad - relationship error
- Index(es):
Relevant Pages
|