Question

I tried the following code to import a string from XML

<xs:element minOccurs="0" name="FIELDNAME" type="xs:string" />

But some fields are more than 255 characters. So I tried adding more characters:

<xs:element minOccurs="0" name="FIELDNAME">
    <xs:simpleType>
        <xs:restriction base="xs:string">
            <xs:maxLength value="1024" />
        </xs:restriction>
    </xs:simpleType>
</xs:element>

The data that fails validation is 194 characters long including the CDATA. It does not include the single quotes (they are there to show the white space):

<FIELDNAME><![CDATA[
                                                              '
900207 4.5" FOOTED BOWL                      <BR>
                                                                       '
]]></FIELDNAME>

The error in SQL Server SSIS 2008 is:

Error: 0xC02090FA at Import, XML Source [1]: The "component "XML Source" (1)" 
failed because truncation occurred, and the truncation row disposition on 
"output column "FIELDNAME" (149)"  at "output "DATA" (10)" specifies failure
on truncation. A truncation error occurred on the specified object of the
specified component.

How would I construct the XML schema first listed to import this data without error?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top