May 6, 2010 at 8:59 am
I have a package that is located in the following folder:
C:\Documents and Settings\gmazzone\My Documents\Visual Studio 2008\Projects\Migrate
When I use the following code (in a script task):
MsgBox(System.IO.Directory.GetCurrentDirectory)
I get:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
as the location for the current directory.
When I run from DTS ExecUtil I get the correct location.
Does anyone know if this is normal for SSIS packages? Is there any way around this issue?
I'm using the path to load other packages and create connections for files in the connection manager.
Gary
May 11, 2010 at 10:51 am
Its hard to get the directory where a dtsx is running from a Script Task because each Script Task is as one dll.
This dll is compiled and executed from some path like
c:\documents and settings\<user>\local configuration\temp\ssis\3c5d064e6c0a4085965b857687350f7f\bin\st_163fce6a47a34129a9d635632dec3ded.vbproj.dll
Also in SSIS you cant work with relative paths.
So the solution I give you is to create a variable and load throught indirect configurations the path where your dtsx are allocated.
Later in the Flat File connection create a expression with this variable + child package Name.
May 11, 2010 at 10:51 am
Its hard to get the directory where a dtsx is running from a Script Task because each Script Task is as one dll.
This dll is compiled and executed from some path like
c:\documents and settings\<user>\local configuration\temp\ssis\3c5d064e6c0a4085965b857687350f7f\bin\st_163fce6a47a34129a9d635632dec3ded.vbproj.dll
Also in SSIS you cant work with relative paths.
So the solution I give you is to create a variable and load throught indirect configurations the path where your dtsx are allocated.
Later in the Flat File connection create a expression with this variable + child package Name.
PD: Sorry for triple post...the proxy is automatic sending three times each form I submit...
May 11, 2010 at 10:51 am
Its hard to get the directory where a dtsx is running from a Script Task because each Script Task is as one dll.
This dll is compiled and executed from some path like
c:\documents and settings\<user>\local configuration\temp\ssis\3c5d064e6c0a4085965b857687350f7f\bin\st_163fce6a47a34129a9d635632dec3ded.vbproj.dll
Also in SSIS you cant work with relative paths.
So the solution I give you is to create a variable and load throught indirect configurations the path where your dtsx are allocated.
Later in the Flat File connection create a expression with this variable + child package Name.
June 10, 2010 at 6:46 am
I'd also like to be able to figure out where my package is running from, the actual location of the package file. this is so I know where to write my checkpoint file and log file. Currently I only have variables I set in my config file, or where the source flat file is, so I have to write my checkpoint file there instead. There may be cases though, where I do not have rights to write the checkpoint file to the location where my flat file is.
Thanks,
Chris
Learning something new on every visit to SSC. Hoping to pass it on to someone else.
June 16, 2010 at 1:54 am
I had a similar problem, where the package could be run on 3 different servers, which had different file layouts. I solved it by having a script task at the beginning which checked the server name using [font="Courier New"]Dts.Variables("System::MachineName").Value.ToString[/font], then set the data location, database server name and so on accordingly.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply