November 12, 2014 at 3:10 am
OK. According to your original question, the package was already failing before you added this new column.
That issue needs to be solved first.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 12, 2014 at 3:12 am
Phil Parkin (11/12/2014)
arunnrj87 (11/12/2014)
I have added by going to DataFlow Task -->Flatfile Source -- >Right Click Show Advanced Editor-->Component Properties -- > Under Custom Properties-->In FileNameColumnName--> i have five the Column Name as FtpDate and then Clicked Ok
Thats all i have done.
This is not the way we suggested. Leave the flat file source untouched. Add a derived column after the flat file source.
It is exactly what I suggested though 😉
You add a column containing the filename of the flat file using that little trick, and then you retrieve the date from that filename.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 12, 2014 at 3:16 am
Koen Verbeeck (11/12/2014)
Phil Parkin (11/12/2014)
arunnrj87 (11/12/2014)
I have added by going to DataFlow Task -->Flatfile Source -- >Right Click Show Advanced Editor-->Component Properties -- > Under Custom Properties-->In FileNameColumnName--> i have five the Column Name as FtpDate and then Clicked Ok
Thats all i have done.
This is not the way we suggested. Leave the flat file source untouched. Add a derived column after the flat file source.
It is exactly what I suggested though 😉
You add a column containing the filename of the flat file using that little trick, and then you retrieve the date from that filename.
I should have read more carefully.
I was thinking you were suggesting the usual FEL --> SSIS variable --> Derived Column method.
November 12, 2014 at 3:18 am
Phil Parkin (11/12/2014)
I was thinking you were suggesting the usual FEL --> SSIS variable --> Derived Column method.
That's an option as well, but this trick is more for the lazy people 😀
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 12, 2014 at 3:21 am
No it was running perfectly and after adding the new column into the database i got error.
November 12, 2014 at 3:22 am
Ok i have added the Derived column and what Expression i need to give ..
November 12, 2014 at 3:31 am
Hi all I have addedd the Derived Column and added the New column name
In that what Expression i need to give for getting the FIlename Date
Like ''ACTEST00001_20141111_0408_SV_APPT.Txt'' this is the File name and i need only the date from this file name ,so what kind of Expression i need to give pls suggest me !!
November 12, 2014 at 3:33 am
Do you need the date only or the time portion as well?
Start with SUBSTRING...
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 12, 2014 at 3:34 am
I nend only the date present in that file name.
November 12, 2014 at 3:41 am
Try the following:
(DT_DBDATE)(SUBSTRING(myFileName,13,4) + "-" + SUBSTRING(myFileName,17,2) + "-" SUBSTRING(myFileName,19,2))
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 12, 2014 at 3:47 am
This Expression i have already used and we cannot uss the SUBSTRING in date datatype.
THis is Comming Error.
Please suggest some other Expressions.
Which Extract only the date
November 12, 2014 at 3:49 am
arunnrj87 (11/12/2014)
This Expression i have already used and we cannot uss the SUBSTRING in date datatype.THis is Comming Error.
Please suggest some other Expressions.
Which Extract only the date
This makes no sense.
The column that contains the filename does not have a date data type, it is a string.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 12, 2014 at 4:02 am
C:\Clients\BlackBook\BlackBookMarketing\SQLScripts\AuthenticomDailyProject\Samplefiles
In this path i have the files and the filename is
ACTEST00001_20141111_0408_INV.TXT
How to use this Expression
(DT_DBDATE)(SUBSTRING(myFileName,13,4) + "-" + SUBSTRING(myFileName,17,2) + "-" SUBSTRING(myFileName,19,2))
to pull the above file name.
I have give Column Name FtpDate in the Derived Column.
November 12, 2014 at 4:08 am
If you have the full path in the file name column, then of course you don't start your count for the substring at 13, but at 100 (if I counted correctly).
Another option is to use FINDSTRING to find the first occurrence of an underscore in the filepath and then start your substring expression from there.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
November 12, 2014 at 4:12 am
Just a quick check. Can you confirm the data type (in SQL Server) of the new date column please?
Viewing 15 posts - 16 through 30 (of 38 total)
You must be logged in to reply to this topic. Login to reply