Avatar of taslim shaikh
taslim shaikh
 asked on

xml files


I've never worked with xml files.  I'm getting 30+ files with data that I need to load into sql table.  How do I do that

Thanks Taz
SQLXMLMicrosoft SQL Server

Avatar of undefined
Last Comment
taslim shaikh

8/22/2022 - Mon
Ryan Chong

you can try openxml or xpath to do that.
Naitik Gamit

Daniel Jones

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Ryan Chong

if you want to automate the importing process, you probably can use SSIS or build a custom ETL program for that purposes.
taslim shaikh

Hi Naitik Gamit,

The solution you suggested seems good but I get confused with the line below.  My xml files does not have the "ROOT" tag, it has page headers, totals, etc..

Help Taz

SELECT CustomerID, CustomerName, Address
FROM OPENXML(@hDoc, 'ROOT/Customers/Customer')
Naitik Gamit

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
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
taslim shaikh

Thank you
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.