Sql-server – Logging of incorrect row in SQL Server Integration Services

sql serverssis

I newbie to SQL Server Integration Services and I have a problem:

Data loaded from file looks like this:

1 'a' 'b'
2 'a' 'b'
1 'c' 'd'

And this rows would be loaded in table like this:

CREATE TABLE T (
   ID NOT NULL PRIMARY KEY,
    A nvarchar NOT NULL,
    B nvarchar NOT NULL
); 

Cause of ID is primary key third row in input data could not be loaded, and I want to load correct rows (first and second or third and second) and send to log incorrect row.

Best Answer

Check this: https://stackoverflow.com/questions/11628352/etl-ssis-redirecting-error-rows-to-a-seperate-table

It has all the steps you need to have the error records stored somewhere else.