SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 The problem of reading a XML file into a table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

badua
Starting Member

Vietnam
8 Posts

Posted - 03/21/2007 :  00:03:41  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
1837 Posts

Posted - 03/21/2007 :  15:42:48  Show Profile  Reply with Quote
Take a look here
http://www.perfectxml.com/articles/xml/importxmlsql.asp
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000