question

paws27284 avatar image
paws27284 asked

Can an onerror event reload a table that is used in the data flow task that caused the error?

Periodically, I need to load tables with manually updated files. To automate this process I have created a package that creates a backup of the current tableA data; looks for the file and if there continues with a SQL task to truncate tableA and a data flow task to load tableA from the file.

I have an onerror event paired with the data flow task that truncates the tableA and reloads from the backup.

SQL

Truncate table [dbo].[JobClassANDI] 
Insert into[dbo].[JobClassANDI] 
Select * from [dbo].[JobClassANDI_BKP]

To test the onerror event I specifically cause an error. The data flow task continues processing, the onerror SQL task is processing and neither ever finish. I'm thinking it has something to do with the data flow task has the table locked and the onerror SQl task is trying to access it.

Is there a way i can remove the lock from the data flow task once it errors? Is something else happening?

I have also tried using the constraint failure path to execute the same sql task, but even when the data flow task generates the red X, the failure path does not execute.

ssis data flowonerror event
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.