Hi All,
I'm using SQL 2000 and in a DTS I want to load in an error XML file to a SQL table.
I am using the SQLXMLBulkLoad component in an Active X script.
I have an XML file. see below, and also an XSD schema file. Could someone take a look and see where I am going wrong??!
I get an error from SQL stating "Relationsh ip expected on errors"
I need simply the contents of each error_msg tag to populate a field called errormsg in a table called Error_Response table
## START SCHEMA
[HTML]<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDe fault="unqualif ied" elementFormDefa ult="qualified" xmlns:dt="urn:s chemas-microsoft-com:xml:datatyp es" targetNamespace ="mytargetnames pace.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn: schemas-microsoft-com:mapping-schema">
<xs:element name="stockorde r_error" >
<xs:complexType >
<xs:sequence>
<xs:element name="errors" >
<xs:complexType >
<xs:sequence>
<xs:element name="error" sql:relation="E rror_Response">
<xs:complexType >
<xs:sequence>
<xs:element name="error_mes sage" sql:field="erro rmsg" type="xs:string " />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="version" type="xs:string " use="required" />
</xs:complexType>
</xs:element>
</xs:schema>[/HTML]
## END SCHEMA
## START XML FILE
[HTML]
<?xml version="1.0" ?>
<stockorder_err or xmlns="mytarget namespace.com" version="1a" >
<errors>
<error>
<error_message> This is an error</error_message>
</error>
</errors>
</stockorder_erro r>[/HTML]
## END XML FILE
Thanks
mh
I'm using SQL 2000 and in a DTS I want to load in an error XML file to a SQL table.
I am using the SQLXMLBulkLoad component in an Active X script.
I have an XML file. see below, and also an XSD schema file. Could someone take a look and see where I am going wrong??!
I get an error from SQL stating "Relationsh ip expected on errors"
I need simply the contents of each error_msg tag to populate a field called errormsg in a table called Error_Response table
## START SCHEMA
[HTML]<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDe fault="unqualif ied" elementFormDefa ult="qualified" xmlns:dt="urn:s chemas-microsoft-com:xml:datatyp es" targetNamespace ="mytargetnames pace.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn: schemas-microsoft-com:mapping-schema">
<xs:element name="stockorde r_error" >
<xs:complexType >
<xs:sequence>
<xs:element name="errors" >
<xs:complexType >
<xs:sequence>
<xs:element name="error" sql:relation="E rror_Response">
<xs:complexType >
<xs:sequence>
<xs:element name="error_mes sage" sql:field="erro rmsg" type="xs:string " />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="version" type="xs:string " use="required" />
</xs:complexType>
</xs:element>
</xs:schema>[/HTML]
## END SCHEMA
## START XML FILE
[HTML]
<?xml version="1.0" ?>
<stockorder_err or xmlns="mytarget namespace.com" version="1a" >
<errors>
<error>
<error_message> This is an error</error_message>
</error>
</errors>
</stockorder_erro r>[/HTML]
## END XML FILE
Thanks
mh
Comment