如何将xml导入sql,急~~~~~~~~~~~~~~~~~~~~~~~~~
<?xml version='1.0' encoding='gb2312'?>
<merchandises>
<areaCode>11</areaCode>
<systemPart>1</systemPart>
<enterprise>
<Code>110106100003</Code>
<merchandise>
<code>280010</code>
<rptDate>2006-03-03</rptDate>
<merchandiseName>活鸡</merchandiseName>
<brand>null</brand>
<reportType>2</reportType>
<price>0.0</price>
<sale>0.0</sale>
<amount>0.0</amount>
<stock>0.0</stock>
<modifyDate>2006-07-04 06:44:07</modifyDate>
</merchandise>
<merchandise>
<code>280020</code>
<rptDate>2006-03-03</rptDate>
<merchandiseName>白条鸡(批发)</merchandiseName>
<brand>null</brand>
<reportType>2</reportType>
<price>7.4</price>
<sale>29600.0</sale>
<amount>4000.0</amount>
<stock>0.0</stock>
<modifyDate>2006-07-04 06:44:07</modifyDate>
</merchandise>
<merchandise>
<code>130010</code>
<rptDate>2006-03-03</rptDate>
<merchandiseName>鲜猪肉</merchandiseName>
<brand>null</brand>
<reportType>2</reportType>
<price>8.4</price>
<sale>1000440.0</sale>
<amount>119100.0</amount>
<stock>0.0</stock>
<modifyDate>2006-07-04 06:44:07</modifyDate>
</merchandise>
</enterprise>
<enterprise>
<Code>110113100001</Code>
<merchandise>
<code>280010</code>
<rptDate>2006-03-03</rptDate>
<merchandiseName>活鸡</merchandiseName>
<brand>null</brand>
<reportType>2</reportType>
<price>0.0</price>
<sale>0.0</sale>
<amount>0.0</amount>
<stock>0.0</stock>
<modifyDate>2006-07-04 06:44:07</modifyDate>
</merchandise>
<merchandise>
<code>280020</code>
<rptDate>2006-03-03</rptDate>
<merchandiseName>白条鸡(批发)</merchandiseName>
<brand>null</brand>
<reportType>2</reportType>
<price>7.6</price>
<sale>7600.0</sale>
<amount>1000.0</amount>
<stock>0.0</stock>
<modifyDate>2006-07-04 06:44:07</modifyDate>
</merchandise>
<merchandise>
<code>130010</code>
<rptDate>2006-03-03</rptDate>
<merchandiseName>鲜猪肉</merchandiseName>
<brand>null</brand>
<reportType>2</reportType>
<price>9.0</price>
<sale>198000.0</sale>
<amount>22000.0</amount>
<stock>0.0</stock>
<modifyDate>2006-07-04 06:44:07</modifyDate>
</merchandise>
</enterprise>
</merchandises>
数据很多如果用临时表写,出现错误
先按Code为大分类,再按下面的merchandise为小类导入数据库
一个Code对应多个merchandise,Code存入主表
一个merchandise理的内容为一条记录,存入数据表,用Code与主表的Code关联
那个高手帮帮我啊,先谢谢了!!!!!