none
Redirect Errors rows to a separate file RRS feed

  • Question

  • Hello:
    I'm programatically importing data from a flat file to SQL Server table similar to the logic shown in this article:

    http://www.sqlservercentral.com/blogs/on-the-fringe/2013/08/25/creating-and-executing-an-ssis-package-programmatically/

    If there is data truncation for certain rows or if for any reason, the row(s) cannot be imported to the destination table, I would ONLY those rows to be written to a error log file.

    Can someone provide any sample or articles that shows how to handle this?
    Thanks.

    Friday, August 25, 2017 3:58 AM

All replies

  • Hi ganeshuthuvelu,

    To implement and support error outputs in a component, you must first set the UsesDispositions property of the component to true. Then you must add an output to the component that has its IsErrorOut property set to true. Finally, the component must contain code that redirect rows to the error output when errors or truncations occur.

    More explains and sample code with VB, please refer to: Using Error Outputs in a Data Flow Component

    For C# code, you could check this similar thread: SSIS Custom Data Flow Component - Redirect error rows

    Hope this helps.

    Regards,

    Pirlo Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 25, 2017 7:51 AM
    Moderator
  • You can check error in SSIS package get data in notepad file.

    Redirect error in SSIS


    Mssql installation on Centos

    Friday, August 25, 2017 8:29 AM
  • Pirlo:
    Thanks for your response. The part that I don't understand in that link is where does the "Overrrides" code go?

    Public Overrides Sub ProvideComponentProperties()

    ...

    The article is not clear in what I should be overriding. Can you explain ?
    Friday, August 25, 2017 2:11 PM
  • Is there somewhere a comprehensive example that provides a complete sample?. Like I said, I intend to import data from a flat file to SQL Server table and I'm using the "ADO NET Destination" component.
    Friday, August 25, 2017 2:17 PM
  • Hi ganeshuthuvelu,

    Please refer to this similar thread:

    Programmatically configuring error and truncation dispositions for row redirection

    Regards,

    Pirlo Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, August 31, 2017 3:17 PM
    Moderator