johntheface
October 30th, 2008, 09:31 AM
Can someone please explain to me what the Event Handlers in SSIS actually do. I have made a package that loads data from an excel file and puts it into a sql server 2005 database. the steps are:
1. copy tables to temp tables
2. clear the tables
3. read sheet 1 into relevant table
4. read sheet 2 into relevant table
5. read sheet 3 into relevant table
6. copy excel file into a new folder
7. delete temp tables
this works fine and dandy as long as everything is set up properly however if anything goes wrong i want to make it create a text file with the appropriate error message. i know how to make the text file but i can't get the event to fire.
for example, if the excel file is not present when the package runs then it causes an error at step 3 because obviously it can't read from the excel file. so in the OnError event handler for step 3 i placed a script task that creates a text file in a certain directory with an error message saying "cannot read from excel file" only this task doesn't get called. the package simple says an error has occured and terminates.
can someone please tell me what i'm doing wrong
1. copy tables to temp tables
2. clear the tables
3. read sheet 1 into relevant table
4. read sheet 2 into relevant table
5. read sheet 3 into relevant table
6. copy excel file into a new folder
7. delete temp tables
this works fine and dandy as long as everything is set up properly however if anything goes wrong i want to make it create a text file with the appropriate error message. i know how to make the text file but i can't get the event to fire.
for example, if the excel file is not present when the package runs then it causes an error at step 3 because obviously it can't read from the excel file. so in the OnError event handler for step 3 i placed a script task that creates a text file in a certain directory with an error message saying "cannot read from excel file" only this task doesn't get called. the package simple says an error has occured and terminates.
can someone please tell me what i'm doing wrong