0

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.

  • there are two ways... a) Remove primary key ..make as ID Not Null (b) Concatenate the values and then insert i.e. 1 'a,c' 'b,d' 2 'a' 'b' – Niladri Biswas Oct 25 '12 at 8:57
  • @Niladri There are a fixed table structure. – user1733773 Oct 25 '12 at 9:00
  • then 2nd option will work..Concatenate the values and then insert i.e. 1 'a,c' 'b,d' 2 'a' 'b' – Niladri Biswas Oct 25 '12 at 10:17
1

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.

  • Exactly what I would have recommended. – Simon Osborne Jan 24 '13 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy