April 15, 2021 at 4:16 pm
It's simply not there
Do you have all the other Data Flow tools? Conditional Split, Merge, Multicast etc?
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
April 15, 2021 at 4:17 pm
Sorry it's there when I go into Data Flow... my bad
April 15, 2021 at 4:17 pm
April 15, 2021 at 4:21 pm
April 15, 2021 at 4:39 pm
Found the Derived Column Transformation but do I type in my SQL to get the Date from the file name into the "Expression"?
April 15, 2021 at 4:47 pm
Found the Derived Column Transformation but do I type in my SQL to get the Date from the file name into the "Expression"?
No, you need to use SSIS's own expression language (which is a bit like C#). What is the format of your file names (hopefully, there is a common format) and what result do you want to return?
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
April 15, 2021 at 4:54 pm
ConvoEVQ2021-03-22 is the convention of the .csv file names with only the month and day changing. Here I only want to return 2021-03-22 as the value that will be going in the Date field in my SQL Server table.
April 15, 2021 at 6:35 pm
This should give you an idea.
In the Variables pane, I created a variable called FileName and assigned its value.
Then I created the variable FileNameDate and assigned its value as an expression.
The expression simply extracts the final 10 characters of the first part of the filename (before the .)
If you replace User::FileName with your dynamic filename variable in the above expression, it will re-evaluate for each loop iteration.
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
April 15, 2021 at 6:46 pm
What do you mean by "dynamic filename variable"?
April 15, 2021 at 9:24 pm
In your Foreach container, you will configure a variable to be assigned the name (optionally the entire path) of the file being processed on the 'current' loop iteration. That is what I meant.
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
April 16, 2021 at 2:55 pm
I do this all the time, we input files that have the date in the file name. I use a for each loop on the Control Flow and retrieve the file name into a variable. Then use a script task to reformat the date and save it to a date variable. In the Data Flow you can use a Derived Column task to add it to your output columns.
April 16, 2021 at 5:10 pm
How do you get part or all the file name into the variable?
April 19, 2021 at 8:15 am
How do you get part or all the file name into the variable?
You do that in your ForEach Loop Container. When you create this, you have to define what part of the file's name you want to store in the variable (i.e. Full Path, File Name, etc), and then define which variable that is stored in.
For example, in my ForEach Loop I am putting the fully qualified value in the variable User::FilePath
:
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
April 19, 2021 at 2:58 pm
Thanks... within my Loop container I placed an "Execute SQL Task Editor" but I'm having trouble with its needed syntax in the SQL Statement and the Parameter Mapping... something is making the package fail.
April 19, 2021 at 3:04 pm
Thanks... within my Loop container I placed an "Execute SQL Task Editor" but I'm having trouble with its needed syntax in the SQL Statement and the Parameter Mapping... something is making the package fail.
What do you want this ExecSQL task to do?
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
Viewing 15 posts - 16 through 30 (of 55 total)
You must be logged in to reply to this topic. Login to reply