I should have written this down when I came across it -- but I recently saw an example of how to determine a package's currently-executing folder. Can anyone help?
Thanks!
- Mike
Can you elaborate on what you mean by "the current executing folder"?
-Jamie
|||
Jamie Thomson wrote:
Can you elaborate on what you mean by "the current executing folder"?
-Jamie
Thanks, Jamie -- sure, the folder where the DTSX resides as it executes.
Here's the situation -- the DBAs want to put all the packages I've prepared into a single folder.
The "main" package calls each of 42 "sub-packages", one after another. I'm planning to use the
Execute Package task for each of the 42, and set it to "File system" to reference each of the 42.
The Connection property of the Execute Package task wants the path to the DTSX file the Execute Package
task runs, and I'm not sure how to set this at runtime. Because all the packages will live in the same arbitrary
folder, I hoped I might be able to use an expression or something to set the Connection property properly.
Thanks for asking!
- Mike
|||mike.groh wrote:
Jamie Thomson wrote: Can you elaborate on what you mean by "the current executing folder"?
-Jamie
Thanks, Jamie -- sure, the folder where the DTSX resides as it executes.
Here's the situation -- the DBAs want to put all the packages I've prepared into a single folder.
The "main" package calls each of 42 "sub-packages", one after another. I'm planning to use the
Execute Package task for each of the 42, and set it to "File system" to reference each of the 42.
The Connection property of the Execute Package task wants the path to the DTSX file the Execute Package
task runs, and I'm not sure how to set this at runtime. Because all the packages will live in the same arbitrary
folder, I hoped I might be able to use an expression or something to set the Connection property properly.
Thanks for asking!
- Mike
Right. Well as far as I know theres no way for the package to discover where it "lives". The way I solve this is for each package to have a variable called RootFolder which gets set by an indirect configuration. I've talked about it on my blog quite a bit:
Common folder structure
(http://blogs.conchango.com/jamiethomson/archive/2006/01/05/2559.aspx)
Indirect configurations ROCK!
(http://blogs.conchango.com/jamiethomson/archive/2005/11/02/2342.aspx)
Indirect configurations gotcha
http://blogs.conchango.com/jamiethomson/archive/2005/10/31/2336.aspx
-Jamie
|||
Thanks! I'll check it out in your blog.
- Mike
No comments:
Post a Comment