Error handling in Script component at validation process in SSIS

Abhishek Sharma 21 Reputation points
2022-02-08T14:25:34.253+00:00

Hi All,

I am facing below issue can somebody help me.
I have a package for loading data from multiple CSV to SQL Server. Package is already developed now i have to do Error handling. I am using below Steps.

1) we are using For each container for getting CSV file.
2) Then Script component for handling the Source(CSV) file then OLEDB Destination to Load into SQL Server DB.
3) Now i want to do error handling in Script Component also. I am getting truncation error at Script Component Validation time for some record from CSV File and package is going to failed. I want my package should not failed and redirect that data into Error Table and then continue for others record.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,714 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,453 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 40,816 Reputation points
    2022-02-08T14:44:25.93+00:00

    There is a build-in function for, which you can use.
    See
    Lesson 4-3: Add error flow redirection
    Error Handling in Data

    0 comments No comments

  2. ZoeHui-MSFT 32,821 Reputation points
    2022-02-09T02:35:48.353+00:00

    Hi @Abhishek Sharma ,

    Although you cannot directly configure an output as an error output in the Script component for automatic handling of error rows, you can reproduce the functionality of a built-in error output by creating an additional output and using conditional logic in your script to direct rows to this output when appropriate.

    Please refer to simulating-an-error-output-for-the-script-component.

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments