Link to home
Start Free TrialLog in
Avatar of Auerelio Vasquez
Auerelio VasquezFlag for United States of America

asked on

How to get part of file name parsed to the columnns in SSIS

Looking to get the first three characters of a file name into a column in sql.What is the best way to do that ?

for example:

file name = ALB_20150725.csv

All I want is ALB, and i want to insert this value into a column
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Auerelio Vasquez

ASKER

I apologize I didn't clarify. I'm using a derrived column with a variable name:

trying to use this:

substring(@[User::v_Filename],37,3)

however, it seems substring can only handle 20 characaters ?

the file name looks like this:
D:\Projects\OTS\MYSSA Dashboard\Data\ATL_20150725Text.csv

All I want is the ATL Portion

but when the ssis moves to the next file, it may change to NYC or DAL, there are about 26 files to be processed all from different regions.