I'm fairly certain you should use SQLXMLBulkLoad for this.
Introduction, details, examples, limitiations (and some more):
http://msdn.microsoft.com/
.Net implementation:
http://msdn.microsoft.com/
Main Topics
Browse All TopicsI have a HUGE XML file which I want to load into Sql Server 2005 Table. I have the xsd file for this as well.
I have tried SSIS, and it works for smaller files (using Data Transfrom > XML Source), however if I am trying to import a big file 100MB+ XML Source just turns RED, increasing the buffer size just does nothing.
My Goal is to get this HUGE xml file into a SQL Table with columns.
Please advise what should I do, I am also open to alternate solutions
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I'm fairly certain you should use SQLXMLBulkLoad for this.
Introduction, details, examples, limitiations (and some more):
http://msdn.microsoft.com/
.Net implementation:
http://msdn.microsoft.com/
You can use OPENROWSET and XML.nodes. This is another fast method.
DECLARE @xmlInput AS XML
SET @xmlInput =
(
SELECT * FROM OPENROWSET(
BULK 'C:\1.xml',
SINGLE_BLOB) AS x
)
--;WITH XMLNAMESPACES (default 'http://schemas.microsoft.
SELECT
T.C.value('@groupCode', 'varchar(255)') as 'groupCode'
,T.C.value('@groupName', 'varchar(255)') as 'groupName'
,T.C.value('(arrivalCode)[
,T.C.value('(arrivalName)[
FROM @xmlInput.nodes('/outbound
adikhan, try to first execute the SELECT. Check if it is working. Compare the performance. If the performance is worse that your old method then it does not make sense to work on this.
INSERT is not big deal. Write a INSERT stmt before the SELECT.
INSERT INTO (column1, column2, ...)
SELECT
T.C.value('@attribute1', 'varchar(255)') as 'column1'
...
Note in the SELECT the first 2 columns are atributes and the next 2 are elements.
Following Codes returns 0 Rows...
DECLARE @xml XML
SET @xml =
(
SELECT * FROM OPENROWSET(
BULK 'C:\SpecBrands\alfco.xml',
SINGLE_BLOB) AS x
)
Select T.C.value('brand_code[0]',
From @xml.nodes('/product_data/
Sample Xml...
<?xml version="1.0" encoding="ISO-8859-1"?>
<product_data xmlns="http://www.specsser
<product_specs>
<classification>
<key>ALFCO:IAIC</key>
<brand_code>ALFCO</brand_code
<brand_name>Alfresco</brand_n
....
adilkhan, take a look at the .Net reference I pasted above. There's a very detailed example from A to Z:
http://msdn.microsoft.com/
Pretty decent example here as well:
http://dotnetslackers.com/
You have to mention the namespace before SELECT.
DECLARE @xml XML
SET @xml =
(
SELECT * FROM OPENROWSET(
BULK 'C:\SpecBrands\alfco.xml',
SINGLE_BLOB) AS x
)
;WITH XMLNAMESPACES (default 'http://www.w3.org/2001/XM
Select T.C.value('brand_code[0]',
From @xml.nodes('/product_data/
Business Accounts
Answer for Membership
by: MelissaSuciadiPosted on 2009-10-01 at 00:34:49ID: 25466592
Hi,
One way I can think right now is how about if you chunk your file into some smaller files?