March 10, 2011 at 8:52 pm
I have a data flow task in a for each container that loads xml files in a folder to database table.
The issue that I am facing is when executed in the for loop, the variable that reads the filename is not
getting the correct value and throwing an error. In the Variable Mappings tab in For Each container, I added a variable
named strFile and used that variable in the expression for xmlfile name in the data flow task.
It seems like the file name is not getting into variable. Please help me if you have gone through the same thing.
March 11, 2011 at 8:26 am
What is the error that you get?
What value did you specify for the index in the variable mappings pane?
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
March 11, 2011 at 8:38 am
Thanks for the response
I am getting a validation error. I am trying to set the file name variable to xmldata property in the expressions.
TITLE: Package Validation Error
------------------------------
Package Validation Error
------------------------------
ADDITIONAL INFORMATION:
Error at Data Flow Task [EmpFile [2256]]: The value for custom property "XMLData" on component "EmpFile" (2256) is incorrect.
Error at Data Flow Task [SSIS.Pipeline]: "component "EmpFile" (2256)" failed validation and returned validation status "VS_ISBROKEN".
Error at Data Flow Task [SSIS.Pipeline]: One or more component failed validation.
Error at Data Flow Task: There were errors during task validation.
(Microsoft.DataTransformationServices.VsIntegration)
March 11, 2011 at 8:47 am
You can try to set a breakpoint at the dataflow, to see if the value of the variable matches your expectations.
Another question: do the XML files always have the same structure? As SSIS is strongly typed about metadata, any metadata change can break your package.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
March 11, 2011 at 8:53 am
All the xml file has the same schema. As you said I tried to put a break point and it seems like I am not getting any value in strFile variable. is there anything wrong in what I am doing to retrieve the file? added a variable named strFile and used that variable for xmldata property.
March 11, 2011 at 2:00 pm
I found the issue, in the xml source editor I didn't select the option "Xml file from variable" in the data access selection
Thanks
March 11, 2011 at 2:07 pm
santh.george (3/11/2011)
I found the issue, in the xml source editor I didn't select the option "Xml file from variable" in the data access selectionThanks
Just one of those days eh?
Time for the weekend!
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy