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 2008 Forums
 Transact-SQL (2008)
 importing large XML files into SQL

Author  Topic 

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2011-02-18 : 15:35:16
For anyone interested I am sharing this so you can avoid a current or future nightmware of bulk inserting large xml file(s)

best way to do it was via vbscript

1. You need to install SQLXML latest on your server (try it in dev first)
2. You need to create and xsd for your xml(s). there are tons of tools out there for that even lowly MS Access can help you create xsd from xml

This is a snippet from the vbscript file



set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkload.4.0")
objBL.ConnectionString = "provider=SQLOLEDB;data source=SERVER_TO_DUMP_XMLTO;
database=YOUrDb;integrated security=SSPI"


objBL.Execute "AssociationSchema2.xsd", "\\YOURSERVER\e$\xml_chunks\" + objFile.Name





If you don't have the passion to help people, you have no passion
   

- Advertisement -