Re: Troubleshooting XML Bulk Load

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Probably something to do with the encoding. Try changing it to UTF-16.

--
Cheers,
Graeme
_____________________
Graeme Malcolm
Principal Technologist
Content Master
- a member of CM Group
www.contentmaster.com
"Illustris" <Illustris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5351EFB8-024B-4685-B660-A2D98D5F3E2D@xxxxxxxxxxxxxxxx
> OK - successfully get data now - but now am getting an "Illegal XML
> characters" error at runtime. Any suggestions on preventing these errors?
> It
> would be very time consuming to search/replace chars in the xml files.
>
> "Graeme Malcolm" wrote:
>
>> OK, try adding sql:field and sql:datatype annotations to the attributes
>> that
>> map to fields.
>>
>> --
>> Cheers,
>> Graeme
>> _____________________
>> Graeme Malcolm
>> Principal Technologist
>> Content Master
>> - a member of CM Group
>> www.contentmaster.com
>> "Illustris" <Illustris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:B60E2DBD-F8E5-4B1C-BE01-7CAA8ACCB652@xxxxxxxxxxxxxxxx
>> > Thanks Graeme, I did add that attribute but still end up with no data.
>> > It
>> > creates the table, maps the columns, but get no data.
>> >
>> > ???
>> >
>> > AB
>> >
>> > "Graeme Malcolm" wrote:
>> >
>> >> Try adding a sql:is-constant attribute to the <terms> declaration in
>> >> the
>> >> schema. As far as I can see, this is just a container element for the
>> >> data,
>> >> and it's the <term> element that actually maps to the table.
>> >>
>> >> Cheers,
>> >> Graeme
>> >> _____________________
>> >> Graeme Malcolm
>> >> Principal Technologist
>> >> Content Master
>> >> - a member of CM Group
>> >> www.contentmaster.com
>> >>
>> >>
>> >> "Illustris" <Illustris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> >> news:DD3AA55C-CC9E-4E60-9579-362FCA729120@xxxxxxxxxxxxxxxx
>> >> > Hi all,
>> >> >
>> >> > 1) I took an existing XML file and created a schema in Visual Studio
>> >> > .NET.
>> >> > 2) built an app to simply import the xml file into a SQL database.
>> >> >
>> >> > Can someone take a look at this and tell me why no table is being
>> >> > created
>> >> > and no data is being sent? I'm not returning any errors, and I'm
>> >> > successfully
>> >> > accessing the database according to SQL Profiler.
>> >> >
>> >> > XML sample:
>> >> > <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>> >> > <terms>
>> >> > <term SourceTerm="string here" Translation="string here"
>> >> > StringCategory="TXT" Platform="string" Product="string"
>> >> > Version="3.0"
>> >> > />
>> >> > </terms>
>> >> >
>> >> > XSD:
>> >> >
>> >> > <?xml version="1.0" ?>
>> >> > <xs:schema id="terms"
>> >> > targetNamespace="http://tempuri.org/fra-bel-xml-MicrosoftBusinessSolutionsAxapta30_2.xsd";
>> >> > xmlns:mstns="http://tempuri.org/fra-bel-xml-MicrosoftBusinessSolutionsAxapta30_2.xsd";
>> >> > xmlns="http://tempuri.org/fra-bel-xml-MicrosoftBusinessSolutionsAxapta30_2.xsd";
>> >> > xmlns:xs="http://www.w3.org/2001/XMLSchema";
>> >> > xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
>> >> > xmlns:sql="urn:schemas-microsoft-com:mapping-schema"
>> >> > attributeFormDefault="qualified" elementFormDefault="qualified">
>> >> > <xs:element name="terms" msdata:IsDataSet="true";
>> >> > msdata:EnforceConstraints="False";>
>> >> > <xs:complexType>
>> >> > <xs:choice maxOccurs="unbounded">
>> >> > <xs:element name="term" sql:relation="G_Terms">
>> >> > <xs:complexType>
>> >> > <xs:attribute name="SourceTerm" form="unqualified" type="xs:string"
>> >> > />
>> >> > <xs:attribute name="Translation" form="unqualified" type="xs:string"
>> >> > />
>> >> > <xs:attribute name="StringCategory" form="unqualified"
>> >> > type="xs:string" />
>> >> > <xs:attribute name="Platform" form="unqualified" type="xs:string" />
>> >> > <xs:attribute name="Product" form="unqualified" type="xs:string" />
>> >> > <xs:attribute name="Version" form="unqualified" type="xs:string" />
>> >> > </xs:complexType>
>> >> > </xs:element>
>> >> > </xs:choice>
>> >> > </xs:complexType>
>> >> > </xs:element>
>> >> > </xs:schema>
>> >> >
>> >> > Thank you!
>> >>
>> >>
>> >>
>>
>>
>>


.



Relevant Pages

  • Re: Troubleshooting XML Bulk Load
    ... Graeme Malcolm ... >> Graeme Malcolm ... >> Content Master ... >> - a member of CM Group ...
    (microsoft.public.sqlserver.xml)
  • Re: SQLXML Managed Classes
    ... need Visual Studio. ... Graeme Malcolm ... Content Master ... - a member of CM Group Ltd. ...
    (microsoft.public.sqlserver.xml)
  • Re: FOR XML AUTO, ELEMENTS
    ... Graeme Malcolm ... Content Master ... - a member of CM Group Ltd. ... You will need to do it with RAW. ...
    (microsoft.public.sqlserver.xml)
  • Re: sp_xml_preparedocument and multiple namespace issue - help!
    ... "Graeme Malcolm" wrote: ... > in the same namespace as the XPath. ... > -- Create an internal representation of the XML document. ...
    (microsoft.public.sqlserver.xml)
  • Re: Mixing Strings
    ... wstring constructor and c_strmember ... Solution: PtrToStringChars and Marshal::PtrToStringUni ... Graeme ...
    (microsoft.public.dotnet.languages.vc)