Hi,
I hav eplaced an expression for the flat file connection as below
@.[User::FileDirectory] + @.[User::FileName]
This is supposed to be used instead of the ConnectionString property of the flat file connection.
You can see that I have created two variables.
The variable
@.[User::FileDirectory] is set to the directory. i.e. I have hardcoded the path to it and assigned it to this variable.
The variable @.[User::FileName] is picked up automatically.
The question is:
When I go to the properties of the flat file connection, I delete the value inside the connectionstring property becuase there is now the expression which is set to the connectionstring.
But when I come back to this property then I am not sure why the connectionstring property gets populated with the directory that I hardcoded to the variable.
Many thanks
arkiboys wrote:
Hi,
I hav eplaced an expression for the flat file connection as below@.[User::FileDirectory] + @.[User::FileName]
This is supposed to be used instead of the ConnectionString property of the flat file connection.
You can see that I have created two variables.
The variable
@.[User::FileDirectory] is set to the directory. i.e. I have hardcoded the path to it and assigned it to this variable.The variable @.[User::FileName] is picked up automatically.
The question is:
When I go to the properties of the flat file connection, I delete the value inside the connectionstring property becuase there is now the expression which is set to the connectionstring.
But when I come back to this property then I am not sure why the connectionstring property gets populated with the directory that I hardcoded to the variable.Many thanks
This is by design. The connectionstring property is picking up the value from the expression. Don't worry about it. It will be correct at runtime.|||
I'm not sure if this is correct because in the connectionstring property it shows:
\\gblond088s0b\D$\ApplData\CEM\WorkingTemp\
and in the expressions it shows:
@.[User::FileDirectory] + @.[User::FileName]Please note that in the variable design I have manually assigned the variable @.[User::FileDirectory] to the path above
Thanks
|||I forgot to mention that it gives the following error:
Error: 2007-07-26 18:10:05.39
Code: 0xC020200E
Source: Data Flow Task Flat File Source [1]
Description: Cannot open the datafile "\\gblond088s0b\D$\ApplData\CEM\WorkingTemp\".
End Error
so basically, it is not seeing the filename. it only sees the directoryname
Thanks
|||
arkiboys wrote:
I forgot to mention that it gives the following error:
Error: 2007-07-26 18:10:05.39
Code: 0xC020200E
Source: Data Flow Task Flat File Source [1]
Description: Cannot open the datafile "\\gblond088s0b\D$\ApplData\CEM\WorkingTemp\".
End Errorso basically, it is not seeing the filename. it only sees the directoryname
Thanks
Right. You need to give the Filename variable a default value. And if, during runtime, it still cannot find the data file, then you aren't populating the Filename variable correctly.|||
This is strange.
If I use a loop and give it the full directory path as described before, the foreach loop picks up the filenames and runs the package successfully. But I do not want to use a loop.
The package gets called once per filename. So the filename gets passed to the package and I want it to run but obviously it does not.
Not sure why the filename does not get populated when it is being passed to the package.
Thanks
|||How are you populating the Filename variable otherwise?|||I have created a variable called @.FileName.
There is also a flat file connection which has a path to the directory as described before.
There is a command prompt which someone else is in charge of running, at the end of this command it passes the filename.
How do you think the filename should get populated?
note that I do not have this problem when I use a foreach loop but for this project loop is not required.
Thanks
|||
arkiboys wrote:
I have created a variable called @.FileName.
There is also a flat file connection which has a path to the directory as described before.
There is a command prompt which someone else is in charge of running, at the end of this command it passes the filename.
How do you think the filename should get populated?
note that I do not have this problem when I use a foreach loop but for this project loop is not required.
Thanks
I'm asking HOW you are passing a value to the Filename variable. HOW is the command line, that someone else is in charge of executing, populating the Filename variable? You need to know this before asking your questions here.|||
Ok,
If I want to run the package myself, how can I do this using the command line?
No comments:
Post a Comment