Avatar of Jordan_WM
Jordan_WM
 asked on

Loading XML File into SQL 2008

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
XMLMicrosoft SQL Server 2008

Avatar of undefined
Last Comment
Jordan_WM

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
5teveo

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Jordan_WM

ASKER
Thanks Steveo, that's exactly what I am looking for :-)
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy