SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Import Multiple XML files into Sql Server using SSIS


Import Multiple XML files into Sql Server using SSIS

Author
Message
naruwithu
naruwithu
Grasshopper
Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)Grasshopper (10 reputation)

Group: General Forum Members
Points: 10 Visits: 115
Hello All...
I have a set of XML files which I need to import into database on Regular basis(after validating some business logic).

I want this to be a scheduled Job in database

Hence started creating an SSIS package to import the XML data into Database table.

I tried the SSIS package with a single XML and it worked very well

I am using Data Flow section with XML Source and Sql Server Destination tools init.


I am just selecting an XML in the XML Source and genenerating an XSD and doing the import process by connect XML source to Sql Server Destination

How can I make this process generic, so that works for all the list of XML files stored in a perticluar location on my server.

Please help me with the steps

Thanku in advance
dave.repton
dave.repton
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1122 Visits: 536
Fairly sure you will be able to adapt the method for importing multiple files shown here
http://www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspx
provided that the definition of the xml files are the same and that they are all saved into the same folder.

Basically a for each container with you dataflow inside it, that loop through a folder and get the file name which is then passed to the xml source component
sultan_vnj
sultan_vnj
SSC-Enthusiastic
SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)SSC-Enthusiastic (165 reputation)

Group: General Forum Members
Points: 165 Visits: 103
Hi There,

The process for loading .csv files or .txt files is pretty much clear.
But the process to load xml files is a bit confusing since I can't use Flat File Connection manager to get the data from .xml files and to set the Connection String proprty.
Please give me the detailed process to load the .xml files into db using For Each Loop container in SSIS.
Please reply if I am not elaborative about the problem.

Thanks,
Srinivas
Sree123
Sree123
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 175
Hey Sultan,

Did you figure out how to XML files? I am having the same requirement now.
Even I am confused as to how to map the variable in FELC as there is no conn str unlike flatfile or Eccel.

Please share your experience.
emile.milne
emile.milne
SSC Journeyman
SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)SSC Journeyman (83 reputation)

Group: General Forum Members
Points: 83 Visits: 224
I'm having the same issue, anybody.
Sumalu
Sumalu
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 4
It seems that importing multiple XML files is a common problem. I need help as well. Anyone out there that can help. Please.....
starshayiz
starshayiz
SSC Rookie
SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)SSC Rookie (49 reputation)

Group: General Forum Members
Points: 49 Visits: 0





mike.moore 23638
mike.moore 23638
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 17
I suppose this thread is not so current, but as I just worked on this I can share the following:

Indeed, there is no separate Connection Manager to edit.

But there is a property for both the xml file path and the xsd file path on the parent Data Flow Task itself.

You can set the Expression for both of those in the Expressions for the Data Flow Task in the same way as you do the Connection String for a Flat File Source.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search