Restart package automatically

Hi there,

I would like to be able to automatically restart a package if it fails with a certain error. This is due to a job that fails every now and then due to a loss in connectivity to the database (when run again no issues).

I know how to catch the message, but is there i way that i can in a script task or some other task restart the whole package when moving into the OnError event for the whole package.

I know this isn't a great way to do it, but its just temporary until we can isolate the network issue that is causing the loss in connectivity.

Thanks

[603 byte] By [pimmy21] at [2007-12-24]
# 1

You would have to restart the packge host, not from within the package itself. A quick way of doing this would be to use a SQL Agent Job and set the try, under the step Advanced page. This would not be specific to the error however.

Another idea would be to put the problematic task(s) inside a For Loop. Using counter variables you can easily determine how many times to loop. You should then be able to influence the loop counter variable within the OnError event handler, or even just use a task with on failure workflow.

DarrenSQLIS at 2007-10-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 2
Thanks for the answer. Im pretty sure the for loop method will pretty much be wot i need. Thanks
pimmy21 at 2007-10-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...

SQL Server

Site Classified