Check for table constraints using ssis packages

  • I am having 2 tables. source table and target table ie

    create table tableA

    (

    id integer

    ,fname varchar(20)

    ,lname varchar(20)

    )

    And

    create table tableB

    (

    id integer

    ,fname varchar(20)

    ,lname varchar(20) not null

    )

    Sample data:

    TableA

    1,'a','aa'

    2,'b',null

    So using packages when I am inserting data from tableA to tableB then package will fail for null records of tableA (fname) as fname cannot be null in destination table.

    How to make sure that packages run fine and the bad data is stored in error_table. Meaning tableB will have only 1 record and 1 record should go to error_table and package should execute successfully.

    Thanks

  • Hello,

    There are a few possibilities, here would be the most obvious two:

    1) Use a Conditional Split before your Insert to evaluate your NULLs and send them to Error_table

    2) Use the Error Output of the Destination Component to forward the rows in errors to your Error_Table

  • Thanks for the Reply:)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply