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)
 Importing Large XML File

Author  Topic 

tgm
Starting Member

1 Post

Posted - 2005-12-28 : 10:46:13
I need some hints on what the best way to load large XML files (20mb+) with relative speed.
Currently, I've got a stored procedure that takes an ntext parameter for the XML and uses OPENXML to insert it into my table. It is essentially user infomation data but the stored procedure also does some business rules checking to make sure all the data loaded is correct and rolls back the whole thing if something is wrong with it.

I'm using JDBC to call the stored procedure and it's taking around 30 min to finish the procedure. If I run it from Query Analyzer it takes around 6.5 min. I did some logging and found that most of the 30 min for the JDBC is just to get the stored proc to start. The procedure itself takes mins once it actually starts.

What are the best practices for this sort of thing?
Can it be done efficiently with a stored procedure or do I need to look into a DTS?

Kristen
Test

22859 Posts

Posted - 2005-12-28 : 11:14:30
There is a BULK XML object which you might be able to use.

I've done the NTEXT thing, as you describe, on multi-megabyte XML and it takes SQL Server a "very long time" to parse the XML.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/anch_SQLXML.asp

Kristen
Go to Top of Page
   

- Advertisement -