Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Load xml into SQL

Author  Topic 

sugaz007
Starting Member

2 Posts

Posted - 2009-10-14 : 10:54:01
Hi,

I have a xml whose structure is as below:

<ns:abcd-XMLInterchange xmlns:dc="http://axc.net/dc/elements/1.1/" xmlns:dcq="http://axc.net/dc/terms/" xmlns:gms="http://www.abcded.gov/CM/gms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.abcd.us/DataStandards/XMLschema/acd/ns https://edt-schema.uk/schema/acd/6.0/XML_Message_Root-V6-0-2008-01-14.xsd" SchemaVersion="6-0" SchemaDate="2008-01-14" xmlns:ns="http://www.test.us/DataStandards/XMLschema/ns">
<ns:Header>
<ns:PersonGeneralinfo>
<ns:Name>abcded</ns:Name>
<ns:Country>abcded</ns:Country>
<ns:OrderInformation>
<ns:OrderID>123</ns:OrderID>
<ns:OrderID>4564</ns:OrderID>
</ns:OrderInformation>
</ns:PersonGeneralinfo>
<ns:PersonOtherInfo>
<ns:Info1>abcded</ns:Info1>
</ns:PersonOtherInfo>
</ns:Header>
</ns:abcd-XMLInterchange>

I want to load the above xml into the SQL tables - Table Person with fields Name,Country & Info1. Table Orders with fields OrderID (multiple rows)

How do I do this above in ssis? If it is a simple xml then xmlsource works fine.

Any technical example is appreciated.

Thanks
Suga
Email id: sugaz007@hotmail.com

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-10-15 : 07:35:10
With this XML source file, you will get 5 outputs that you can re-direct to various SQL tables.

In Data Flow, choose XML Source. Specify the file name. And then click Generate XSD..
And in the Columns section, you'll see the multiple outputs - drop down the Output Name box.

Here's an example (sort of): http://www.bimonkey.com/2009/04/the-xml-source-component-the-basics/
Go to Top of Page
   

- Advertisement -