Monday, March 12, 2012

I'll be posible process a bulk load for following xml document?

the xml doc is:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xs:element name="entity" sql:relation="ENTITY">
<xs:complexType mixed="true">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="entity"/>
</xs:sequence>
<xs:attribute name="name" use="required" sql:field="NAME"/>
<xs:attribute name="descripcion" use="required" sql:field="DESCRIPCION"/>
<xs:attribute name="address" use="required" sql:field="ADDRESS"/>
</xs:complexType>
</xs:element>
<xs:element name="entities" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element ref="entity" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

the table is:

TABLE [dbo].[ENTITY](
[ENTITYNAME] [varchar](50) NULL,
[ENTITYDESCRIPCION] [varchar](200) NULL,
[ENTITYADRESS] [varchar](50) NULL,
) ON [PRIMARY]

GO

SOMEBODY COULD DO IT ?

Yes this shape would be possible to bulkload. However the column names you have specified with sql:field do not match the columns in the database, so if you are having trouble with this schema, that might be one possibility.

<xs:attribute name="name" use="required" sql:field="NAME"/>
<xs:attribute name="descripcion" use="required" sql:field="DESCRIPCION"/>
<xs:attribute name="address" use="required" sql:field="ADDRESS"/>

look like they should be:

<xs:attribute name="name" use="required" sql:field="ENTITYNAME"/>
<xs:attribute name="descripcion" use="required" sql:field="ENTITYDESCRIPCION"/>
<xs:attribute name="address" use="required" sql:field="ENTITYADRESS"/>

-Todd

No comments:

Post a Comment