xml files

taslim shaikh
taslim shaikh used Ask the Experts™
on
Hi,

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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Ryan ChongSoftware Team Lead

Commented:
you can try openxml or xpath to do that.
Naitik GamitSoftware Developer
Top Expert 2015

Commented:
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Ryan ChongSoftware Team Lead

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

Author

Commented:
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')
Software Developer
Top Expert 2015
Commented:
Hello taslim shaikh

ROOT is a top base tag of your xml.provide your xml file.

for example if my xml file looks as
<Country>
<State>
<City>
<Area>

</Area>
</City>
</State>
</Country>

Open in new window

Here Country is root element.

Author

Commented:
Thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial