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)
 Bulk load on xml file

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-08-11 : 07:00:29
Andrew writes "Hi there,

I am researching the bulk load utility of MS-SQL server 2000 and was wondering if you could and would answer the following question for me. We have an xml file that we would like to import into an existing database. We want to strip the tags off so only the data goes in. Now, bulk load of xml data described in the online books and faqs mention creating a bulk load object which you pass the xml schema and xml document to the execute method. All these examples however, used a vb script to create the object. Are there any other ways, in sql or java for example to create the bulk load object model, as we are trying to avoid using vb.

Thanks for any and all help,

Andrew"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-08-11 : 07:03:32
The Bulk Copy object is a COM object, and you can use COM objects in T-SQL via the sp_OACreate and related sp_OA system procedures. Books Online has examples of how to use these procedures. I don't know enough about Java to know if it can use COM objects.

You can also use XSL/XSLT to reformat your XML into a comma- or tab-delimited file and use bcp, BULK INSERT, or DTS to import it into SQL Server (or still use the Bulk Copy object with it)
Go to Top of Page

Andraax
Aged Yak Warrior

790 Posts

Posted - 2003-08-11 : 07:53:25
If you want to use Java, you can use CORBA/RMI to access COM-objects.
Go to Top of Page
   

- Advertisement -