dbTalk Databases Forums  

One XML file with many elements

microsoft.public.sqlserver.xml microsoft.public.sqlserver.xml


Discuss One XML file with many elements in the microsoft.public.sqlserver.xml forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
poorman
 
Posts: n/a

Default One XML file with many elements - 05-13-2011 , 12:11 PM






I'm trying to import a single xml file into a single SQL 2008 R2 table using SSIS. The xml file has many elements so SSIS wants to put them into separate tables. I found how to use the merge to put them into a single table but it splits the data from the two elements into separate rows. Please see below for an example.

WHAT I HAVE.
simplified partial xml file
<element1>name</element1>
<attribute1>john</attribute1>
<element2>address</element2>
<attribute1>123 any place</attribute>

Inserted data
ROW1 john ,null
ROW2 null ,123 any place

WHAT I WANT
ROW1 john ,123 any place

Maybe one of you out there has done this before. The join does NOT have andcommon data EXCEPT that it is all from the same file so they are related by default!

My DataFlow looks like

xml file datasource1 xml file datasource2 (both are pointing to the same file)
Quote:
|
union all

database destination


Thanks in advance
~Jay

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.