How capture an error like "Package Validation Error"

Viewed 529

I what to read some Excel files put by users into a share folder. The issue occurs when the user changes the sheetname or changes the location in some rows or columns used to share data.

In this situation, SSIS show a Package Validation Error.

Package Validation Error------------------------------Package Validation Error------------------------------ADDITIONAL INFORMATION_Error at PackageName [SSIS.Pipeline]_ Leer Staging Modelo LS2 failed validation and returned validation status _VS_NEEDSNEWMETADATA_.Error at PackageName [SSIS.Pipeline]_ One or more component failed validation.Error at PackageName_ There were errors during task validation. (Microsoft.DataTransformationServices.VsIntegration)------------------------------BUTTONS_OK------------------------------

Is possible to capture this kind of error using the event handler or other option to detect the errors?

1 Answers

You can add an Event Handler for the OnError event of the Data Flow Task and read the error description from the System Variables @[System::ErrorCode] and @[System::ErrorDescription]:

If you want to learn more about Event Hanlders check the following article:


Update 1 - Workaround

You can use a Script Task to check if this excel file exists or no using the System.IO.File.Exists() method.

Then you can use Microsoft.Interop.Excel library or System.Data.Oledb to check if the worksheet exists within the Excel file:

Related