Issues with Importing XML file using XML Source and OLE DB task

  • I am importing from a XML file into Tables

     

    The way I have set this up is

     

    I added a Data Flow Task. In the Data Flow pane I added a XML Source task and pointed it to the XML file. I used the Generate XSD option to generate the Schema. I then added several OLE DB Destination tasks and used the ‘New’ option to create the destination Tables, now for all of the other OLE DB tasks everything works fine, however I do have a problem with one element from the XML source file

     

    XML File Extraction

     

    <ErrorMessage type=”HIGHLIGHTED”>

      <MessageLine>THIS IS A MESSAGE</MessageLine>

    </ErrorMessage>

     

    Generated XSD

    <xs:element minOccurs="0" name="ErrorMessage">

      <xs:complexType>

        <xs:sequence>

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

        </xs:sequence>

          <xs:attribute name="type" type="xs:string" use="optional" />

    </xs:element>

     

     In the Advanced Editor for the XML Source Task the DataType for this field is Unicode String{DT_WSTR]

     

     

    In the Advanced Editor for the OLE DB task the corrrasponding OutPut Propertiy is showing Unicode String{DT_WSTR]

     

     

    The field in the table is nvarchar(255)

     

    When running the package I get the following error

    failed because truncation occurred, and the truncation row disposition on "output column "MessageLine" (64667)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.

     

    I don’t understand why I am getting this error. What do I need to amend and how to resolve this issue

  • Problem is sorted, i was using the wrong data connection..... well it is early here  lol

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply