Solved

How do I get the full file path info for the current executing package?

Posted on 2009-05-19
8
327 Views
Last Modified: 2013-11-10
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.
0
Comment
Question by:Jackfy
  • 5
  • 3
8 Comments
 
LVL 22

Expert Comment

by:PedroCGD
ID: 24423612
Are you storing the packages in the file system?
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
0
 
LVL 1

Author Comment

by:Jackfy
ID: 24423674
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?
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 24424002
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
0
 
LVL 1

Author Comment

by:Jackfy
ID: 24424052
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.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 22

Accepted Solution

by:
PedroCGD earned 500 total points
ID: 24424208
Ok...:-)
check the attached package... Use a script task as the first component to execute to update the uvRootFolder
SSIS-Interface.JPG
SSIS-Interface2.JPG
SSIS-ScriptCode-UpdateRootFolder.JPG
Package-EE111-dtsx.txt
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 24424214
helped?
now with ssis variable you can continue your work... correct?
Regards,
Pedro
www.pedrocgd.blogspot.com
www.BIResort.net
0
 
LVL 1

Author Closing Comment

by:Jackfy
ID: 31583059
Thanks. This is exactly what I'm looking for. I forgot to try the Script task.
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 24424328
Dear friend,
I'm very happy and we be here to help you again if you need!
Regards,
Pedro
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SLQ View not updating 10 47
SignalR - getting new data from sql DB 5 65
Convert column to int 13 27
separate column 24 20
Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now