How to know what row crashed my SSIS DataFlow -> ScriptComponent?

Luis Lima 61 Reputation points
2020-09-03T17:42:10.773+00:00

Hi,

I am with a problem that my C# script componente is crashing with the message: "The column has a null value"

But I am executing a data flow over a table with more tem 100.000 rows and more than 60 columns. This simple message is useless to help me to find where is the problems, what is the specific row and the specific column that crashed my script component.

The only thing that I can think to resolve that is in the beginning os the script component write in file the row that will be processed, but be forced to use that to solve this problem is terrible( and this approach will only tell the specific row, not the specific column ).

Would be perfect for me if something like a crashdump could exists or be implemented. Something that tell me what specific row was responsible for my package failure.( Not only in Script Component, failures anywhere in my dataflow )

Best Regards,
Luis

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,575 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 25,856 Reputation points
    2020-09-03T19:12:49.503+00:00

    Hi @Luis Lima ,

    You can add try/catch construct to your code.
    Something along the following:

    catch (Exception ex)  
       {  
    // Don't forget to tick/check off System::TaskName variable as ReadOnly in the Task Parameters  
          Dts.Events.FireError(18, Dts.Variables["System::TaskName"].Value.ToString()  
            , ex.Message.ToString() // add here anything else to identify the record.  
            , "", 0);  
       }  
    

  2. Monalv-MSFT 5,901 Reputation points
    2020-09-04T03:15:42.33+00:00

    Hi Luis,

    We can add Error Flow Redirection in data flow or add Breakpoints in Script Component.

    Please refer to the following links:

    Lesson 4-3: Add error flow redirection

    Debug a Script by Setting Breakpoints in a Script Task and Script Component

    Best Regards,
    Mona

    ----------

    If the response is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.