Error Redirection

  • I have been pulling my hair out all day trying to figure this out, perhaps someone here can help me out.

    I need to redirect rows that throw me an error. I am redirecting these to another table. This table has columns for ErrorMesage, ErrorColumn, And value for that column that threw the error.

    I have gotten the error description using script component. I do not mind having the hardcode the column name from the ErrorColumn number it gives me, I know where to get that number, I am using a derived column for that. The part I am having problems with is giving the value for the column that throws the error.

    any help would be appreciated, thank you.

  • Are you trying to get the actual value (the intersection of the row causing the error and the column) that caused the row to fail?

    I tested it on my dev machine (SQL 2008 R2) and I can see the values of the columns in the error path.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Yes that's what I am trying to get. What do you mean error path?

  • Khades (3/3/2011)


    Yes that's what I am trying to get. What do you mean error path?

    The red arrow in the control flow?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Oh right ok, yeah the information is definitely there. I just needed to know how I can format it to be like:

    Error Message | Column Causing Error | Value of Column Causing Error

    Right now I am using an unpivot on all the columns and using a conditional split to only show the column which is causing the error. Is there another way?

  • The condition split and the unpivot seem like a good solution to get rid of the other columns.

    The unpivot is a semi-blocking transformation, but you shouldn't worry about it too much, as normally you won't have too many error rows. (I hope :-))

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 6 posts - 1 through 5 (of 5 total)

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