liveBook · Manning

Redirect row

As explained in 100 SQL Server Mistakes and How to Avoid Them

Redirect-row behavior sends rows that encounter component errors or truncations to a separate error output instead of discarding them or failing the component.

Redirect-row behavior sends rows with component errors or truncations to a separate error output instead of discarding them or failing the data flow. This preserves dirty data from untrusted sources while allowing the main load to continue. section 6.1

Configure redirect-row handling as a controlled error path:

  • Create an error-handling table with columns for the failed source row, error code, and error column. section 6.1
  • Add a destination for failed rows and connect the component’s red error-output connector to it. section 6.1
  • Set the Error Output page to redirect rows with errors and truncations. section 6.1
  • Map the error-output column manually when destination names differ, because automatic mapping may fail. section 6.1
  • Review redirected rows with application support to decide whether to repair them, discard them safely, or request a corrected extract. section 6.1

Mistake: ignoring bad rows

A flat-file load fails because a significant cookie ID is invalid. Setting the source to ignore failures makes the package appear successful, but silently loses data. Redirecting the row inserts it into ImpressionLoadFailures for investigation while the valid rows continue loading. section 6.1

Listing 6.2 Creating an error table
CREATE TABLE staging.ImpressionLoadFailures (
   FlatFileSourceErrorOutputColumn    VARCHAR(MAX)    NOT NULL,
   ErrorCode                          VARCHAR(MAX)    NOT NULL,
   ErrorColumn                        VARCHAR(MAX)    NOT NULL
) ;

Use the error-table definition as a starting point for storing the failed source value, error code, and error column. section 6.1

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Explains the configuration path, error-table design, connector wiring, error settings, and manual column mapping.
Examples
Uses an invalid cookie ID, an ImpressionLoadFailures table, a red error connector, and a failed flat-file row.
What it assumes
Assumes basic SSIS data-flow and destination knowledge while demonstrating error outputs, staging tables, and failure review from concrete examples.
What you can do after
Operate/configure SSIS error outputs that retain failed rows for application-support investigation.
How it connects
Connects redirect rows with staging tables, ETL, error handling, external data, and OLE DB destinations.

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.