XML import into SQL SERVER 2005 - CDATA

  • Hi,

    I am trying to upload a xml file into sql server 2005 but I keep getting "Data mapping to column 'url_times' was already found in the data. Make sure that no two schema definitions map to the same column".

    I have copied the xml and xsd file below. If I change the XML file to only have IMI number and the first urlaccessed it works fine but when I use the entire file (with multiple urlaccessed) i get the above mentioned error.

    Can you please advice where i am going wrong?

    XML FILE:

    ?xml version="1.0" standalone="yes" ?>

    VZ>

    IMI IMI_Number="35621887" />

    Internet>

    UrlAccessed Time="2008-06-03 8:48:09 am" Url="CDATA">

    ![CDATA[ http://www.google.com/

    ]]>

    /UrlAccessed>

    UrlAccessed Time="2008-06-03 8:48:11 am" Url="CDATA">

    ![CDATA[ http://www.google.ca/

    ]]>

    /UrlAccessed>

    UrlAccessed Time="2008-06-03 8:48:12 am" Url="CDATA">

    ![CDATA[ http://www.google.ca/m

    ]]>

    /UrlAccessed>

    UrlAccessed Time="2008-06-03 8:48:14 am" Url="CDATA">

    ![CDATA[ http://www.google.ca/xhtml/images/google.gif

    ]]>

    /UrlAccessed>

    UrlAccessed Time="2008-06-03 8:48:15 am" Url="CDATA">

    ![CDATA[ http://www.google.ca/m/ping?source=magmahome

    ]]>

    /UrlAccessed>

    /Internet>

    /VZ>

    XSD:

    ?xml version="1.0" encoding="UTF-8"?>

    xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

    xsd:annotation>

    xsd:appinfo>

    sql:relationship name="va"

    parent="va_app3"

    parent-key="IMEI"

    child="va_app3"

    child-key="IMEI" />

    /xsd:appinfo>

    /xsd:annotation>

    xsd:element name="Z" sql:is-constant="1">

    xsd:complexType>

    xsd:sequence>

    xsd:element ref="IMI" sql:relation="va_app3"/>

    xsd:element ref="Internet" sql:relation="va_app3"/>

    /xsd:sequence>

    /xsd:complexType>

    /xsd:element>

    xsd:element name="IMI" sql:relation="va_app3" sql:relationship="va">

    xsd:complexType>

    xsd:attribute name="IMI_Number" sql:field="imei_number" use="required" type="xsd:integer"/>

    /xsd:complexType>

    /xsd:element>

    xsd:element name="Internet" sql:relation="va_app3" sql:relationship="va">

    xsd:complexType>

    xsd:sequence>

    xsd:element ref="UrlAccessed"/>

    /xsd:sequence>

    /xsd:complexType>

    /xsd:element>

    xsd:element name="UrlAccessed" sql:use-cdata="1">

    xsd:complexType>

    xsd:simpleContent>

    xsd:extension base="xsd:anyURI">

    xsd:attribute name="Time" sql:field="url_times" use="required"/>

    xsd:attribute name="Url" sql:field="url" use="required" type="xsd:NCName"/>

    /xsd:extension>

    /xsd:simpleContent>

    /xsd:complexType>

    /xsd:element>

    /xsd:schema>

  • Hi,did you got solution of this problem i am having same problem.

  • Got the Reason why error comes?and it leads me to schema modification.

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

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