Tuesday, March 27, 2012

Error Redirected to Script Component : Package Doesnt fail.

I have created a data flow task. In that, in a 'data conversion', if a column fails validation then that row is redirected to a script component, which in turn writes the error to a variable.

But though the error is generated and script component receives the error, package doesnt fail.

Is there any way to set the package result to failure inside the script component? I tried set 'FailPackageOnFailure' to true but doesnt work.

Any help is greatly appreciated.

Thanks,

Don

donMahya wrote:

I have created a data flow task. In that, in a 'data conversion', if a column fails validation then that row is redirected to a script component, which in turn writes the error to a variable.

But though the error is generated and script component receives the error, package doesnt fail.

Is there any way to set the package result to failure inside the script component? I tried set 'FailPackageOnFailure' to true but doesnt work.

Any help is greatly appreciated.

Thanks,

Don

You could raise an error within the script component using:

Me.Events.FireError(...) (something like that anyway)

-Jamie

|||

Sorry for the delay. Wasnt working on this part for some time.

I tried

Me.ComponentMetaData.FireError(0, "", strErrDesc, "", 0, True) - Where strErrDesc is error decription.

but still no luck

I tried setting the maxerrorcount to 0 but No Luck. Package still completes without any failure.

Any help or ideas are greatly appreciated.

Thanks,

Don

|||

You should return the failure value inside of your script main method. I do not remember the exact enumeration value but the intellisence will give it to you.

Thanks.

No comments:

Post a Comment