Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Problem with having mutiple script tasks in an SSIS Package Expand / Collapse
Author
Message
Posted Wednesday, April 28, 2010 6:34 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 16, 2010 2:08 PM
Points: 6, Visits: 42
I have a package with 3 control flow tasks all enclosed in a sequence container. For each of these taks I have added a script flow task in the "OnError" event handler. I am trapping the error in a variable.

To the sequence container I have added a script task which takes the value from this variable and sends an email.

However the error message I receive is repeated 3 times even though only one of the tasks has the error. Is it because all the script tasks have the entry point as "ScriptMain".

Can we have mutiple script tasks with the same entry point? Please advice how to proceed.
Post #912457
Posted Wednesday, April 28, 2010 7:36 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, May 15, 2014 5:11 PM
Points: 6,067, Visits: 5,283
Joseph,
I'm sorry, I'm having trouble visualizing what you are describing. Could you post a screen print of the package? I think that will be enough..

CEWII
Post #912477
Posted Thursday, April 29, 2010 12:43 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 3:14 AM
Points: 4,977, Visits: 11,669
We need to understand a bit more about the logical flow of your package, I think.

You can easily check out your Script Main suspicion - just try changing it to be unique (and changing the entry point).



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #912569
Posted Thursday, April 29, 2010 9:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 16, 2010 2:08 PM
Points: 6, Visits: 42
The attached doc file shows the layout. This contains 2 SQL Exceute tasks. For each of these tasks the on error event contains a Script task to collect the error and place in a variable.

The Collect All Errors (Script task) collects the errors and sends an email. In this situation the error is repeated twice.

I have even changed the Class Name in the script tasks, to something other than ScriptMain, and also the entry points but I still get the message repeated.



  Post Attachments 
SSIS_TrapErrors.doc (23 views, 44.00 KB)
Post #913017
Posted Thursday, April 29, 2010 9:51 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 3:14 AM
Points: 4,977, Visits: 11,669
Surely your e-mail task needs to be outside of the Sequence container, after the Collect All Errors task?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #913027
Posted Thursday, April 29, 2010 9:58 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 16, 2010 2:08 PM
Points: 6, Visits: 42
The email is outside the sequence container. The script task "Collect All Errors' collects all the errors and sends the email
Post #913030
Posted Thursday, April 29, 2010 9:58 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, May 15, 2014 5:11 PM
Points: 6,067, Visits: 5,283
Ok, I have a better idea..

Every script task is effectively its own "class" there shouldn't be any issue with each having its own ScriptMain..

So I don't think that is your problem...

CEWII
Post #913031
Posted Thursday, April 29, 2010 10:07 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 3:14 AM
Points: 4,977, Visits: 11,669
So what do Email_Start and Email_Success do?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #913045
Posted Thursday, April 29, 2010 10:12 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 16, 2010 2:08 PM
Points: 6, Visits: 42
The Email Start just sends an email that the package has started and the Email Success sends an email if the job completed successfully
Post #913051
Posted Thursday, April 29, 2010 10:27 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 3:14 AM
Points: 4,977, Visits: 11,669
Have you tried debugging the Script Task to see whether that gives you any clues about what is happening?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #913065
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse