Ken Brubaker

The ClavèCoder

<September 2008>
SuMoTuWeThFrSa
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011


Navigation

Subscriptions

News

Kenneth Brubaker
Senior Application Architect

Locations of visitors to this page

Post Categories



SQL Server: Doing bulk inserts with .NET and OPENXML

This Microsoft Knowledge Base article explains how to stream an XML file over to SQL Server and load it into the database using OPENXML to allow bulk inserts. Although OLE DB had support for bulk inserts directly, I believe this is the only way with .NET.

However, OPENXML doesn't support BLOB columns. The bums. :-)

Update: Fixed link.

Update: Joshua Allen tips us off about XML Bulk Insert in SQLXML. There is a COM object in SQLXML 3.0, SQLXMLBulkLoad, that “basically shreds the XML and uses the BCP interface to load into the database, so it's ultra-fast and works with huge files.” (download) The problem here, of course, is that SQLXML is not included as part of the .NET Framework. There is a .NET Interop assembly available, but it does not appear to wrap the SQLXMLBulkLoad object. However this may be the ticket to loading really big data sets fast. Thanks, Joshua!

posted on Friday, March 19, 2004 5:43 AM by kenbrubaker





Powered by Dot Net Junkies, by Telligent Systems