August 14, 2018 at 9:20 am
Hi Team,
I have a Script task(VB code),I have the output as filename to pick the most recent file from my folder but how do I pass this filename as input to my data flow task??
Any ideas or suggestions will be appreciated.
Let me know if you need further explanation.
Thanks
SE
August 14, 2018 at 9:25 am
sathwik.em91 - Tuesday, August 14, 2018 9:20 AMHi Team,I have a Script task(VB code),I have the output as filename to pick the most recent file from my folder but how do I pass this filename as input to my data flow task??
Any ideas or suggestions will be appreciated.
Let me know if you need further explanation.Thanks
SE
Put the file name into a package-scoped SSIS variable. It's not clear how you want to use this in your data flow, but this should work, depending on your requirement.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
August 14, 2018 at 9:46 am
Phil Parkin - Tuesday, August 14, 2018 9:25 AMsathwik.em91 - Tuesday, August 14, 2018 9:20 AMHi Team,I have a Script task(VB code),I have the output as filename to pick the most recent file from my folder but how do I pass this filename as input to my data flow task??
Any ideas or suggestions will be appreciated.
Let me know if you need further explanation.Thanks
SEPut the file name into a package-scoped SSIS variable. It's not clear how you want to use this in your data flow, but this should work, depending on your requirement.
Thanks for your reply Phil,
It's not clear how you want to use this in your data flow:
To Answer your question I need to pass three columns from my output file to my dataflow task.
August 14, 2018 at 10:15 am
create all your variables you need in your SSIS package.
Pass them to your script task.
then in your code, read them into a variable, assign a value to them in your code, and finally send them back to SSIS; your subsequent processes can use the variables, and your script task assigns the new value.
string FullFileName= (string)Dts.Variables["FullFileName"].Value;
//some logic to get some values
FullFileName = GetLastRecord();
Dts.Variables["FullFileName"].Value = FullFileName
Lowell
August 14, 2018 at 11:19 am
sathwik.em91 - Tuesday, August 14, 2018 9:46 AMThanks for your reply Phil,
It's not clear how you want to use this in your data flow:
To Answer your question I need to pass three columns from my output file to my dataflow task.
So is your question about how to configure the data flow to use the dynamic file name stored in the package variable as a data source? If not, please clarify what you are asking for.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
August 14, 2018 at 12:05 pm
Phil Parkin - Tuesday, August 14, 2018 11:19 AMsathwik.em91 - Tuesday, August 14, 2018 9:46 AMThanks for your reply Phil,
It's not clear how you want to use this in your data flow:
To Answer your question I need to pass three columns from my output file to my dataflow task.So is your question about how to configure the data flow to use the dynamic file name stored in the package variable as a data source? If not, please clarify what you are asking for.
Phil-Yes can you let me know the process of configuring the data flow task to use the filename stored in the variable as a datasource??
August 14, 2018 at 12:28 pm
sathwik.em91 - Tuesday, August 14, 2018 12:05 PMPhil Parkin - Tuesday, August 14, 2018 11:19 AMSo is your question about how to configure the data flow to use the dynamic file name stored in the package variable as a data source? If not, please clarify what you are asking for.Phil-Yes can you let me know the process of configuring the data flow task to use the filename stored in the variable as a datasource??
OK, easy enough. Create a connection to your flat file in the usual way.
Then, open the Expressions property for the connection and override the ConnectionString property for the connection, using the variable you have created.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
August 15, 2018 at 2:00 pm
Or you can change the connection string for the flat file connection manager in code in you script. This example is setting the zip file connection for a load process:
Dts.Connections("CWC-COUNTY-RIVERSIDE-DEPT_OF_PUBLIC_SOCIAL_SERVICE.zip").ConnectionString = Dts.Variables("User::ZipFile").Value.ToString
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply