Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Foreach file location

Author  Topic 

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2009-03-26 : 09:06:15
Hey I've an ssis package that deals with many files on a weekly basic. so i drop all of the file into a weekly folder named W01 , W13 etc. but this mean that i have to keep changeing my foreach loop to point at the weekly folder thats created.

Is there a way that i can do this without having to manually change the foreach to point to the weekly folder.?

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-03-26 : 10:06:53
You can create a variable and store the path in that variable. Every time you execute the package, you can change the path in the XML config file that the package uses for execution.
Go to Top of Page

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2009-03-26 : 10:28:04
I've created avariable and i've stored the path in the variable.
example i've stored this path \\net\loc\files

I was trying to use the expression in the foreach to sent the property of the option directory to be the variable +'W'+ datepart(wk,getdate())

so it would give me \\net\loc\files\W13

but i can't get the expression to work.
Go to Top of Page
   

- Advertisement -