Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 can't get xml into sql

Author  Topic 

mikejohnson
Posting Yak Master

153 Posts

Posted - 2005-01-13 : 13:11:58
hey, i've tried openxml (xml file too big) and also sqlxmlbulkload. with the bulk load i get tables created but no data in the tables and a couple fields missing. any help?

xsd:
<?xml version="1.0"?>
<xs:schema id="ROOT" targetNamespace="http://tempuri.org/400m.xsd" xmlns:mstns="http://tempuri.org/400m.xsd" xmlns="http://tempuri.org/400m.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="ROOT" msdata:IsDataSet="true" msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="CLIENT">
<xs:complexType>
<xs:sequence>
<xs:element name="NOTES" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="NOTE" nillable="true" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent msdata:ColumnName="NOTE_Text" msdata:Ordinal="2">
<xs:extension base="xs:string">
<xs:attribute name="dtcreated" form="unqualified" type="xs:string" />
<xs:attribute name="code" form="unqualified" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="ssn" form="unqualified" type="xs:string" />
<xs:attribute name="lastName" form="unqualified" type="xs:string" />
<xs:attribute name="firstName" form="unqualified" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>


xml sample:
<ROOT><CLIENT ssn="111111111" lastName="test" firstName="test">
<NOTES>
<NOTE dtcreated="11/12/03 03:31 PM" code="">1</NOTE>
<NOTE dtcreated="11/13/03 03:32 PM" code="">2</NOTE>
</NOTES>
</CLIENT>
<CLIENT ssn="111111112" lastName="test" firstName="test">
<NOTES>
<NOTE dtcreated="11/12/03 03:33 PM" code="">3</NOTE>
<NOTE dtcreated="11/13/03 03:34 PM" code="">4</NOTE>
</NOTES>
</CLIENT></ROOT>
   

- Advertisement -