Friday, February 24, 2012

bulk import to sql 200

How can i implement this ussing bulk load or do i need to find other way to import it?
it was working until i recieved a new file with CDATA.
in advance thanks.
here is a sample xml
<data>
<row>
<MYDIV_CDE><![CDATA[ES ]]></MYDIV_CDE>
<MYDIV_DESC><![CDATA[Esc ]]></MYDIV_DESC>
</row>
</data>
here is my xsd
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
<xsd:element name="row" sql:relation="TblVMDDivisions" >
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DivisionIdent" type="xsd:integer" />
<xsd:element name="MYDIV_CDE" type="xsd:string"
sql:use-cdata="1"/>
<xsd:element name="MYDIV_DESC" type="xsd:string"
sql:use-cdata="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema
this is error that i get
<?xml version="1.0"?>
<Result State="FAILED">
<Error><HResult>0xC00CEE2B</HResult>
<Description><![CDATA[Illegal xml character.]]></Description>
<Source>XML SAX Parser</Source>
<Type>FATAL</Type>
</Error>
</Result>
Felix
hi there,
by testing the code I found out that if xml file has only one 'row' it works just fine but if it has more than one it fails with the same error that i post in original message.
any ideas why i will work for one row at the time but not for more than one?
Felix
"Felix" wrote:

> How can i implement this ussing bulk load or do i need to find other way to import it?
> it was working until i recieved a new file with CDATA.
> in advance thanks.
> here is a sample xml
> <data>
> <row>
> <MYDIV_CDE><![CDATA[ES ]]></MYDIV_CDE>
> <MYDIV_DESC><![CDATA[Esc ]]></MYDIV_DESC>
> </row>
> </data>
>
> here is my xsd
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
> <xsd:element name="row" sql:relation="TblVMDDivisions" >
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element name="DivisionIdent" type="xsd:integer" />
> <xsd:element name="MYDIV_CDE" type="xsd:string"
> sql:use-cdata="1"/>
> <xsd:element name="MYDIV_DESC" type="xsd:string"
> sql:use-cdata="1" />
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema
> this is error that i get
> <?xml version="1.0"?>
> <Result State="FAILED">
> <Error><HResult>0xC00CEE2B</HResult>
> <Description><![CDATA[Illegal xml character.]]></Description>
> <Source>XML SAX Parser</Source>
> <Type>FATAL</Type>
> </Error>
> </Result>
>
> Felix
|||What are the characters inside the CDATA section?
Note that XML does not allow certain binary code points (such as the ESC
code point) regardless of whether they are inside a CDATA section or not.
Best regards
Michael
"Felix" <Felix@.discussions.microsoft.com> wrote in message
news:24962467-0738-46CD-B286-96A80F53225D@.microsoft.com...[vbcol=seagreen]
> hi there,
> by testing the code I found out that if xml file has only one 'row' it
> works just fine but if it has more than one it fails with the same error
> that i post in original message.
> any ideas why i will work for one row at the time but not for more than
> one?
> Felix
> "Felix" wrote:

No comments:

Post a Comment