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
 SQL Server Development (2000)
 Import XML in 2 tables with SQLXMLBulkLoad

Author  Topic 

dev_guy
Starting Member

3 Posts

Posted - 2005-02-17 : 09:05:04
Hi there!

Tables are:

tblParent ( id,lokalname)
tblChild (id, kategorie, name, referenz)

id = primary key in tblParent

The SampleData.xml file is:

<?xml version="1.0" encoding="iso-8859-1"?>
<toptipp>
<lokal>
<id>W01973</id>
<lokalname>Arka</lokalname>
<bilder>
<bild kategorie="logo" name="Logo" referenz="W01973.jpg"/>
<bild kategorie="galerie" name="Galeriebild1" referenz="W01973-001.jpg"/>
<bild kategorie="galerie" name="Galeriebild2" referenz="W01973-002.jpg"/>
</bilder>
</lokal>
</toptipp>


The VBScript code I use is:

set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.3.0")
objBL.ConnectionString = "provider=SQLOLEDB;data source=localhost;database=Mywind;integrated security=SSPI"
objBL.ErrorLogFile = "c:\error.log"
objBL.Execute "SampleSchema.xml", "SampleData.xml"
set objBL=Nothing

Please help me with the SampleSchema.xml for the SampleData.xml. Thanks!
   

- Advertisement -