Jackfy
asked on
How do I get the full file path info for the current executing package?
I have set of SSIS pacakges. I want to make my SSIS application more portable. When I move the SSIS files from one location to another, the connection string for the sub package can always be correctly populated based on the parent package's location.
For example I have package A.dtsx and B.dtsx, where A is the parent of B. If all the files are copied under C:\SSIS, when A kicks of B, the connection string should be C:\SSIS\B.dtsx. If the files are executed from C:\Program Files\SSIS, the connection string for B should be C:\Program Files\SSIS\B.dtsx.
The question is, regardless where A.dtsx is lcoated, how I can obtain the file location in SSIS when it's executed?
Thanks.
For example I have package A.dtsx and B.dtsx, where A is the parent of B. If all the files are copied under C:\SSIS, when A kicks of B, the connection string should be C:\SSIS\B.dtsx. If the files are executed from C:\Program Files\SSIS, the connection string for B should be C:\Program Files\SSIS\B.dtsx.
The question is, regardless where A.dtsx is lcoated, how I can obtain the file location in SSIS when it's executed?
Thanks.
ASKER
Yes, I do store them in the file system. And I do have the SSIS variable "RootFolder" to store the root folder info. My question is, instead of using DTEXEC to overwrite it from the DOS commandt, how I can have the value of that variable automatically refreshed within SSIS, as I described in my original post?
Add this code to a bat file
set OLDDIR=%CD%
dtexec /F "%OLDDIR%\pckLoadData.dtsx
rename the package name from pckLoadData.dtsx to your package name and execute the BAT file
Helped?
Pedro
www.pedrocgd.blogspot.com
www.BIResort.net
set OLDDIR=%CD%
dtexec /F "%OLDDIR%\pckLoadData.dtsx
rename the package name from pckLoadData.dtsx to your package name and execute the BAT file
Helped?
Pedro
www.pedrocgd.blogspot.com
www.BIResort.net
ASKER
Hi PedroCGD, as mentioned in my earlier reply, I'm looking for the SSIS solution, "instead of using DTEXEC to overwrite it from the DOS command". I'm wondering if there's any system info I can grab from. I checked all the available system variable and this info isn't there.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
helped?
now with ssis variable you can continue your work... correct?
Regards,
Pedro
www.pedrocgd.blogspot.com
www.BIResort.net
now with ssis variable you can continue your work... correct?
Regards,
Pedro
www.pedrocgd.blogspot.com
www.BIResort.net
ASKER
Thanks. This is exactly what I'm looking for. I forgot to try the Script task.
Dear friend,
I'm very happy and we be here to help you again if you need!
Regards,
Pedro
I'm very happy and we be here to help you again if you need!
Regards,
Pedro
You already tried to use SSIS variable that store file system folder to pass to the package B?
regards,
Pedro
www.pedrocgd.blogspot.com
www.BIResort.net