Wednesday, March 21, 2012

Multiple XML Files as DataSource

Hi All,

New to the forums, so, hello.

I want to import data from multiple XML files into SQL 2005 using SSIS. I know how to set up a flat data source etc... but am unsure how I would go about importing from multiple files.

Anyone got any ideas?

Thanks,
Drammy

For XML files, you obviously use the XML source.

The multiple files issue is the same for flat files or XML files, generally the For Each Loop container, which has a For Each File enumerator.

There are plenty of example of how to use this, including Books Online. Here is just one -

Looping over files with the Foreach Loop
(http://www.sqlis.com/55.aspx)

|||Thanks DarrenSQLIS,

Drammy
|||I have actually found that this doesn't work with XML files...

I'm getting an error:

TITLE: Editing Component

The component has detected potential metadata corruption during validation.
Error at Import XML Files [XML Source [1]]: The property "XMLDataVariable" on the component "XML Source" (1) was empty.

Error at Import XML Files [XML Source [1]]: The component "XML Source" (1) was unable to read the XML data.

Error at Import XML Files [XML Source [1]]: There was an error setting up the mapping. Pipeline component has returned HRESULT error code 0xC02090D0 from a method call.

It may not be possible to recover to a valid state using a component-specific editor. Do you want to use the Advanced Editor dialog box for editing this component?

BUTTONS:

&Yes
&No

Any ideas?
|||

Even if you are using expressions to populate certain properties at run time; BIDS requires some properties have an 'initia' or 'design time' value; so the task/package can be validate. Make sure you provide a value for XMLDataVariable property in XML Source component.

If you are doing so, then provide more details of what you are doing in the package.

sql

No comments:

Post a Comment