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)
 The problem of reading a XML file into a table

Author  Topic 

badua
Starting Member

8 Posts

Posted - 2007-03-21 : 00:03:41
Hi you all,
I have an XML file as the following:
<?xml version="1.0" standalone="yes"?>
<DataSet>
<xs:schema id="DataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="DataSet" msdata:IsDataSet="true" msdata:Locale="vi-VN">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="STS_ORDERS">
<xs:complexType>
<xs:sequence>
<xs:element name="ORDER_NO" type="xs:string" minOccurs="0" />
<xs:element name="ORDER_DATE" type="xs:dateTime" minOccurs="0" />
<xs:element name="ORDER_TIME" type="xs:string" minOccurs="0" />
<xs:element name="MEMBER_ID" type="xs:decimal" minOccurs="0" />
<xs:element name="ORDER_TYPE" type="xs:decimal" minOccurs="0" />
<xs:element name="PRIORITY" type="xs:decimal" minOccurs="0" />
<xs:element name="ORDER_QTTY" type="xs:decimal" minOccurs="0" />
<xs:element name="ORDER_PRICE" type="xs:decimal" minOccurs="0" />
<xs:element name="STATUS" type="xs:decimal" minOccurs="0" />

</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<STS_ORDERS>
<ORDER_NO>210307B006004</ORDER_NO>
<ORDER_DATE>2007-03-21T00:00:00.0000000+07:00</ORDER_DATE>
<ORDER_TIME>09:48:11:000</ORDER_TIME>
<MEMBER_ID>342</MEMBER_ID>
<ORDER_TYPE>1</ORDER_TYPE>
<PRIORITY>1</PRIORITY>
<ORDER_QTTY>1500</ORDER_QTTY>
<ORDER_PRICE>80000</ORDER_PRICE>
<STATUS>1</STATUS>
</STS_ORDERS>
<STS_ORDERS>
<ORDER_NO>210307B006005</ORDER_NO>
<ORDER_DATE>2007-03-21T00:00:00.0000000+07:00</ORDER_DATE>
<ORDER_TIME>09:48:11:000</ORDER_TIME>
<MEMBER_ID>45</MEMBER_ID>
<ORDER_TYPE>1</ORDER_TYPE>
<PRIORITY>1</PRIORITY>
<ORDER_QTTY>400</ORDER_QTTY>
<ORDER_PRICE>86000</ORDER_PRICE>
<STATUS>1</STATUS>
</STS_ORDERS>
</DataSet>


and I have to read this file into a SQL 2000 Server table every 10 seconds.

At the moment, I use an Windows form application in which
a Timer executes objDataSet.ReadXml, then executes Insert into the table every 10 seconds.

The performance is not good because the XML file size is rather big (about 5MB). Anyone could give me a better solution?

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2007-03-21 : 15:42:48
Take a look here
http://www.perfectxml.com/articles/xml/importxmlsql.asp
Go to Top of Page
   

- Advertisement -