Load xml files in a folder and load into different ole db tables:
It is hard to say if the empty file will be processed, why don't you try? After all we do not have anything concrete. On the surface, the solution will involve a ForEach Loop in which you would need to check for data presence in case you do not want to load the "empty" file(s). A solution like this <cite>www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspx</cite> is a good starring point I think.Arthur My Blog
August 27th, 2011 6:47pm

Hi, I have a set of xml files and one xsd which contains schema for almost more than 30 tables. I am able lo load one xml file into many destination tables using data flow task in ssis as per the xsd file. My question is :How would I be able to load all the xml files from a particular folder into respective destinations ,irrespective of whether data is present or not . Each xml file varies from other due to lack of data. for example : client may not have a child so there won't be any childinfo ,etc.. Please suggest. Thanks, JR
Free Windows Admin Tool Kit Click here and download it now
August 27th, 2011 7:33pm

Hi, Thanks for the reply. It is not the matter of for each loop container for picking the files from a folder. I would like to know how can I load them into respective target tables automatically ?I don't have an idea if I can use script component or anything else for mapping to target tables . Thanks, JR
August 27th, 2011 7:41pm

Hi, Thanks for the reply. It is not the matter of for each loop container for picking the files from a folder. I would like to know how can I load them into respective target tables automatically ?I don't have an idea if I can use script component or anything else for mapping to target tables . Thanks, JR Does the columns vary between different target tables?SSIS Tasks Components Scripts Services | http://www.cozyroc.com/
Free Windows Admin Tool Kit Click here and download it now
August 27th, 2011 8:46pm

Hi Cozy, No. they are fixed. Data just goes into various tables depending on the file. I know the target table names. How can I map them automatically for each xml file is my problem. Thanks, JR
August 27th, 2011 9:27pm

If you use standard OLE DB Destination component, you can setup the target table name to be retrieved from variable. So what you have to do is setup this variable to the appropriate target table for the specific xml file, before the data flow task is executed.SSIS Tasks Components Scripts Services | http://www.cozyroc.com/
Free Windows Admin Tool Kit Click here and download it now
August 27th, 2011 9:57pm

Thanks for the reply cozy. the xml file almost goes into various destinations upto 20 tables. Will this work using a variable ? else any script component or something has to be done ?
August 27th, 2011 10:38pm

Thanks for the reply cozy. the xml file almost goes into various destinations upto 20 tables. Will this work using a variable ? else any script component or something has to be done ? It should work for unlimited number of tables.SSIS Tasks Components Scripts Services | http://www.cozyroc.com/
Free Windows Admin Tool Kit Click here and download it now
August 27th, 2011 10:39pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics