2

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?

Hadi
  • 36,233
  • 13
  • 65
  • 124
  • One thing you could do is write something to validate the files BEFORE trying to import them. Then handle the error that way and send email or something if the validation does not match what you expect. You should be able to do this relatively easily (if you know c#) in an SSIS c# script task. – Brad Jun 26 '19 at 16:54

1 Answers1

0

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:

Hadi
  • 36,233
  • 13
  • 65
  • 124