all groups > sql server dts > march 2007 >
You're in the

sql server dts

group:

Re-run the package after catching an error


Re-run the package after catching an error Panos Stavroulis.
3/14/2007 9:09:43 AM
sql server dts:
Hi,

I've got an Event handler that catches exceptions. That works perfectly and
it also sends emails to warn of the failure. Now what I would like to do is
instead of emailing on every failure, I would like to re-start the package
and send an email only if the package has failed 3 times. I can re-start the
package via the run package task, but I don't think I will be able to save
how many times the package failed. Unless, I save into a database table which
makes it more cumbersome.

Can I jump at the beginning of the package execution from the Event handler
and will Internal variable will be re-set though if the package re-runs? How
about checkpoints. What's the best technical solution to re-running packages.
Thanks.

Panos.
RE: Re-run the package after catching an error Sundar Murugappan
3/15/2007 8:34:10 AM
1) I would uncheck "Fail on package error"
in package logging property under <file> menu
2) use OSQL or DTSRUN utiltiy to re-execute the package

Usage: dtsrun /option [value] [/option [value]] ...
Options ('/?' shows this screen; '-' May be substituted for '/'):

Package retrieval:
/~S Server Name
/~U User Name
/~P Password
/E <Use trusted connection instead of /U /P>
/~N Package Name
/~M Package Password
/~G Package Guid String
/~V Package Version Guid String
/~F Structured Storage UNC filename (overwritten if /S also specified)
/~R Repository Database Name <uses default if blank; loads package from
repo
sitory database>

Package operation (overrides stored Package settings):
/~A Global Variable Name:typeid=Value <may quote entire string
(including na
me:typeid)>
/~L Log file name
/~W Write Completion Status to Windows Event Log <True or False>

DTSRun action (default is to execute Package):
/!X <Do not execute; retrieves Package to /F filename>
/!D <Do not execute; drop package from SQL Server (cannot drop from
Storage
File)>
/!Y <Do not execute; output encrypted command line>
/!C <Copies command line to Windows clipboard (may be used with /!Y and
/!X)
[quoted text, click to view]

Notes:
~ is optional; if present, the parameter is hex text of encrypted value
(0x3
13233...)
Whitespace between command switch and value is optional
Embedded whitespace in values must be embedded in double-quotes
If an option is specified multiple times, the last one wins (except
multiple
/A)


Hope this helps

Cheers
Sundar

[quoted text, click to view]
AddThis Social Bookmark Button