Search code examples
c#sql-serverssisrhino-etl

How do we get Rhino ETL to redirect bad rows to a different destination table?


We are migrating an SSIS package to Rhino ETL. The SSIS package currently outputs bad rows to an alternate destination table where all columns are nullable and varchar. Good rows go to the real destination table but upon error, it will redirect the bad rows to this other error table. Is there a way to make Rhino ETL do the same?

The destination tables are Sql Server 2008 R2 SP2.


Solution

  • What we did was we had to create two processes. The first would end in a bulk copy write. The second would do a row by row write.

    If the bulk copy fails, we would kick off the row by row process.

    Then, we overrode the OutputCommandOperation's Execute method because it was doing everything in a transaction. Because of this, everything would be backed out on a failure.

    We took the transaction out, added a catch on the execute non query and added an error column to the row with the exception and changed it from a yield break to a yield return row.

    Then we registered a FailWrite operation in the row by row process that would be the last step and it would write any row that had an error column into the error destination.