Can I redirect rows on error in SSIS if the error happens within an "if condition", not while writing the column value?
0
votes
0
answers
117
views
I know how I redirect rows on error or truncation. That works if you have an error while you insert a value into the column.
- Truncation: Say you have a string of 10 characters and you insert it into a column of
char(5)
. That is a truncation that you can redirect to an error output table.
- Error: Say you insert an int
into a varchar(10)
column. The data types will not match and the row is redirected to the error output table.
But I do not seem to get a row redirected if an error happens inside the calculation of a column, and at [Changing MaximumErrorCount when executing maintenance plan](https://dba.stackexchange.com/questions/128973/changing-maximumerrorcount-when-executing-maintenance-plan/) , I was asked to make my remark a new question:
> After changing MaximumErrorCount to a high number, I still did not get any redirected rows to the error table. It just stopped the job, but I would want the job to go on and throw only the erroneous rows out to the error table. My problem was that I casted a number as AS DECIMAL(4,2)
) even though it had to be AS DECIMAL(5,2)
), see [how to resolve DTS_E_OLEDBERROR. in ssis](https://stackoverflow.com/a/78176256/11154841) . But such an error should normally just redirect the row to the error table and not stop the job, shouldn't it?
The string column could be built as such: check whether a number is bigger than 9 and output the string "warning, high number" in a column called "Warnings and checks".
If then after years, a number 100
pops up the first time ever as a clear outlier that was never thought to happen, and if that number is cast to AS DECIMAL(4,2)
inside such an "if condition" of a column even though it has to be AS DECIMAL(5,2)
, there is an error that stops the SSIS job.
See also [SQL Query not throwing error even if the entered scale value is higher than specified](https://dba.stackexchange.com/questions/126227/sql-query-not-throwing-error-even-if-the-entered-scale-value-is-higher-than-spec) for another data type (here: numeric
) question that would throw the same error.
I want the SSIS job to go on and just redirect the row to the error table also if an error happens inside an "if condition". Changing the MaximumErrorCount
to a high number does not fix it. Can it be done at all? Should it be done at all?
Asked by questionto42
(366 rep)
Mar 23, 2024, 11:53 AM
Last activity: Mar 23, 2024, 12:16 PM
Last activity: Mar 23, 2024, 12:16 PM