0

I have been given a task to load a simple flat file into another using ssis package. The source flat file contains a zip code field, now my task is to extract and load into another flat file that accepts only the ones with correct zip code which is 5 digit zip code , and redirect the invalid rows to a new file.

Since I am new to SSIS, any help or ideas is much appreciated.

2
  • Is all you're checking is that it's 5 digits? That leaves lots of possiblities for invalid zip codes.
    – Andrew
    Aug 4, 2014 at 21:02
  • yes. I want to direct rows with matching 5 digits to one flat file and the other zip codes (more than 5 digit) to other flat files.
    – apariyar
    Aug 4, 2014 at 21:05

1 Answer 1

1

You can add a derived column which determines the length of the field. Then you can add a conditional split based on that column. <= 5 goes the good path, > 5 goes the reject path.

2
  • Thanks for the idea, but it turns out that it was something else I was asked to do. It's handling the error caused by one or more rows like zip code with more than 5 digits without failing the task.
    – apariyar
    Aug 4, 2014 at 21:44
  • Heck, just truncate it then.
    – Andrew
    Aug 4, 2014 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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