complex logic
Hi All,
I am trying to create package but unable to assign match file name row's value to the variables.I do not have much time to think about it ,need to create package as early as possible.
Here is the requirement
Table A
FileName FilePath ID
Format Email
abc c:\Folder 123
Excel kim@gmail.com
pqt c:\Folder 456
PDF rohit@gmail.com
klm c:\Folder 876 Excel
shilpa@
Folder contain different files( eg abc,pqt ,lko,jhg etc)
We need to match folder file name such as abc with Table A filename column if it exists than need to assign all rows values to variables but not single variable all in different variables .I already created variables such as filename ,filepath,ID,format,email.Please
let me know .thanks
isb123
December 21st, 2010 7:34pm
One way would be to create a derived column that you use an expression to build the fully qualified path to the file to fill you variable later possibly in a script task. It would weigh heavily in how I would go about this based on the amount of data
that is being looked at also.
I'd like to know where and how you determine the file extension before giving you too much advice though. That would make a difference in the way I would go about this. Since you do not have it in the table example you posted, I have to assume
you only know the Format based as Excel and not xls or xlsx?
You could also simplify the task and base your Data Flow off a query. In that query you can build the qualified path. Then since you need each row in unique variables; use a for loop on that in a for loop container or simply shred it in a script
task. Similar to how Andy Leonard shows in this blog
http://sqlblog.com/blogs/andy_leonard/archive/2007/10/14/ssis-design-pattern-read-a-dataset-from-variable-in-a-script-task.aspx
only instead of writing the string value, assign the variables after locking them in the script taskTed Krueger
Blog on lessthandot.com @onpnt on twitter
Please click the Mark as Answer button if a post solves your problem!
Free Windows Admin Tool Kit Click here and download it now
December 21st, 2010 8:02pm