We help IT Professionals succeed at work.

Loading XML File into SQL 2008

316 Views
Last Modified: 2014-05-26
Hello,

I very new to loading XML files into SQL Server 2008 and trying to understand what would be the best solution to do this. I have been presented with an CXML which is 4gigs and a XSD file. I have been able to load the XML file into a table with a XML column as shown below in the following script.

INSERT INTO Test_XML_Column
SELECT 10, xCol
FROM    (SELECT *    
    FROM OPENROWSET (BULK 'G:\Data\TestData.xml', SINGLE_CLOB)
 AS xCol) AS R(xCol)

What I am now trying to understand is how get the data elements out of the XML column, is there a way I can leverage the XSD file creating an assembily, creating another table to hold the XSD information or hard code the data elements to get into in SQL query to parse out the values and get into SQL tables.

Thanks,

LJ
Comment
Watch Question

Top Expert 2012
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks Steveo, that's exactly what I am looking for :-)
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.