SQL Server 2012 - Loading XML Documents

preview_player
Показать описание
This video describes how to load an XML document into SQL Server using OPENROWSET. It also goes over how to query the XML document like a table using OPENXML.

The SQL code used in the video is available at:
Рекомендации по теме
Комментарии
Автор

Great explanation.. Actually it gives you the start point to investigate and explore more complex real life cases... You rock man !

CevicheChessSalsa
Автор

With OPENXML, you can treat the XML files like tables. So if you have multiple XML files, and there is a common element/attribute in those files that you can join with, then once you bring it into SQL with OPENXML, you can join on that field. For example, say I have 2 product xml files. The first file contains the Name for product 10. The second file contains ProductNumber and ListPrice for product 10. I can join these two files together using the ProductID field to get all the information.

askadba
Автор

THANK YOU!!! I was totally stuck on a grad-level XML import problem for an Advanced ISE class. You the MAN!

madiganr
Автор

Thanks heaps!!! It's so clear how you demonstrate this tutorial.

jojieurbiztondo
Автор

Thank you so much. This gave me the building blocks for my transaction

omarreyes-torres
Автор

Thank you for your example. Please show how to update a table -no insert but update table- with your example. Where do I put de UPDATE, where de FROM and the WHERE statement?

ronaldbakxgmailcom
Автор

man. What a tutorial. Tis is great. Very well explained

yannickbass
Автор

How to load XML data for more number of records.... Say 10000 records using the same approach because it is taking 20 min to do the How to optimize the same... Thanks

gauravpratap
Автор

Thanks!!! And what I can do if I try to read more XML's? For example, into a folder

IgorGeorgeAbdo
Автор

This is an excellent tutorial! Thank you for posting this!!

TheDellhp
Автор

Hi. I tried to load XML file using SSIS package (XML Source) but with issues. The XML file has a multi-value tag Author. I use - - instead brackets b/c post doesn't allow tags.
-Items-
-Item-
-ASIN-0747557462-/ASIN-
-Author-Sarah Brown-/Author-
-Author-Gil McNeil-/Author-
-Title-Magic-/Title-
-/Item-
...
-/Items-
In SSIS package, the Author tag was dropped in the destination table. Other columns were loaded no problem. How to load the XML including Author column?

jxin
Автор

Can we use XML parser in SQL server 2016 ?

deepikajoshi
Автор

Hi
Terrrific video. I faced one problem. I could not find sp_xml_preparedDocument in SQL 2014 express edition. Any comment on this would be much appreciated.

Thanks
FazalH

fhpatvi
Автор

They are sending Invoices in the form of XML files  and would like to upload into the SQL table.

Knsoftusa
Автор

How to load mutiple XML files into SQL server? I have 500 XML files to load into SQL server.

Knsoftusa
Автор

Very good explanation. It helps me a lot!

marvinchaves
Автор

My xml file is namespace format,
How do I can get 'AA', not 'aa'.
Thanks.  
          <Memory>
            <DataField fieldName="aa">AA</DataField>
            <DataField fieldName="bb">BB</DataField>
          </Memory>

philchen
Автор

thanks for this tutorial - simple and logical. thanks once again

Ayappan.
Автор

Thank you, very good!. this is the help I need to complete my project. Excellent

Angelatino
Автор

How did you get the data from xml to SQL table? I get an error...Operating system error code 21 (The device is not ready.).

ArpanKarmakar
visit shbcf.ru