BKennedy2008
asked on
SQL String with DTS, using split string
I have a derived Column transformation in my DTS package that gets a Job number using an expression:
SUBSTRING(@[User::CurrentE xcelPath], 51,12) where (@[User::CurrentExcelPath] contains the filepath.
My job numbers have changed where length will not work.
I need to change to a split string.
My End goal is to strip out the job numbers from a given path. The below is 2 examples of a path
Example #1
W:\ProcessFiles\Labor_Shee t_Importat ion_123\ JOBNO_2014-01-01014_11331_ URI- Daily Labor-Culpepper Recon 1-2-14.xlsm
Example #2
W:\ProcessFiles\Labor_Shee t_Importat ion_123\ JOBNO_2014-01-0001-RECON_1 1331_URI- Daily Labor-Culpepper Recon 1-3-14.xlsm
end result for Job Number will be:
"2014-01-0104"
"2014-01-0001-RECON"
How can I change this to strip out the job Number using a split string and will
derived column transformation Expression accept a split string?
The number of underscores will always be the same, 3, but the lenght may vary from 12 to 18 now.
SUBSTRING(@[User::CurrentE
My job numbers have changed where length will not work.
I need to change to a split string.
My End goal is to strip out the job numbers from a given path. The below is 2 examples of a path
Example #1
W:\ProcessFiles\Labor_Shee
Example #2
W:\ProcessFiles\Labor_Shee
end result for Job Number will be:
"2014-01-0104"
"2014-01-0001-RECON"
How can I change this to strip out the job Number using a split string and will
derived column transformation Expression accept a split string?
The number of underscores will always be the same, 3, but the lenght may vary from 12 to 18 now.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I think the script component is the path I would like to take, just need to figure out how to assign the input and output of the variables, the input being the @[User::CurrentExcelPath]
ASKER
Thanks for the help. I used a Script Component and used split function and set a variable to the JobNO Part. More coding than I wanted, but got the trick done.
ASKER