Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Following snippet works within SSIS 2012 --- derive colum block.

TOKEN(REPLACE(@[User::FileName],".csv",""),"\\",TOKENCOUNT(REPLACE(@[User::FileName],".csv",""),"\\"))

But it does not work within SSIS 2005. TOKENCOUNT was not recongnized according to the error dialog. Any suggestions which alternative could be used?

share|improve this question
    
What version of SSIS are you trying to find compatibility for? –  Thomas Stringer Sep 25 '13 at 16:01
    
existing 2012 stuff down to 2005 (no joke). sql servers are dev edition. –  mnemonic Sep 26 '13 at 9:11
add comment

1 Answer

up vote 1 down vote accepted
REPLACE(RIGHT(@[User::FileName],FINDSTRING(REVERSE(@[User::FileName]),"\\",1)-1),".csv","")
share|improve this answer
    
a parenthesis was removed when using your solution. thx a lot. –  mnemonic Sep 26 '13 at 17:33
    
Whoops! Corrected. –  SQLFox Sep 30 '13 at 15:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.