Reputation: 17
I have a ssis package with flat file and oledb destination..
i need to get the date from file name and add it as new column in DB
but it is not working
I did this in derived column
SUBSTRING(@[User::OS_file],27,10)
but it returns date when tried in sql-server
file name is like this
asjfbdsajfsd_21-08-2001_osss.log
i need 21-08-2001
how evere trying with SUBSTRING(@[User::OS_file],27,10)
results me this
Upvotes: 0
Views: 105
Reputation: 35318
Seems like you're using the wrong index in your SUBSTRING
. It looks like it's pulling part of the path instead of part of the file name. What if you do this?
SUBSTRING(@[User::OS_file],50,10)
Note, I've changed the start index from 27
to 50
.
Upvotes: 2