how to package stop
hi in package if any error is getting then automaticallly stop the package. that's why in onerror event i took one script task,wrote this code. staticvoid Main(string[] args) { Application app = new Application(); RunningPackages pkgs = app.GetRunningPackages("yourserver"); int pkgsRunning = pkgs.Count; Console.WriteLine("Packages before s foreach (RunningPackage p in pkgs) { Console.WriteLine("InstanceID: " + p.InstanceID); Console.WriteLine("PackageDescription: " + p.PackageDescription); Console.WriteLine("PackageID: " + p.PackageID); Console.WriteLine("PackageName: " + p.PackageName); Console.WriteLine("UserName: " + p.UserName); } pkgs = app.GetRunningPackages("yourserver"); foreach (RunningPackage package in pkgs) { package.Stop(); } pkgsRunning = app.GetRunningPackages("yourserver").Count; Console.WriteLine("Packages after stop " + pkgsRunning); } but my package not stoppedwaht can i do?anybody please give me solution.. indu
May 18th, 2012 5:36am

Indu, stopping packages immediately in code, event handlers or using a GUI (e.g. Agent job) is not quite possible especially if it is executing a datapump in a DFT or many other types of execution. The SSIS engine does not accept immediate stop request because it has to complete the currently executing operation, do a cleanup, etc. In your case, I guess, the package does stop eventually, before reaching a next task, but you expect it to stop still right where it is, right? By the way packages do stop on errors by default so why do you need this code?Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2012 9:49am

but if error is getting,then automatically stop the package. how can i follow/ can you please suggestet me.. in c#.net appilication.exit() is there. like ssis any methods is there can you please suggest me. please give me best solution. indu
May 18th, 2012 9:53am

So what you are trying to do is stop any package that is currently running if your package has an error? Seems a bit dangerous. If all you want to do is stop the current package on error then just set the fail package on failure property to True on any of the tasks that should fail out the package. Chuck
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2012 10:11am

i am trying to stop the package if package has error.indu
May 18th, 2012 10:13am

It will stop on its own without writing any code. Set the Fail Package on Failure Property to True on each task in the package.Chuck
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2012 10:16am

Hi sriindugorijavolu, I suggest you can use OnError event in your package or use Logging to capture the error information. At run time, executables (packages and Foreach Loop, For Loop, Sequence, and task host containers) raise events. An OnError event is raised when an error occurs. For more information about it, please see: http://msdn.microsoft.com/en-us/library/ms140223.aspx With logging, you can capture run-time information about a package, helping you audit and troubleshoot a package every time it is run. For example, a log can capture the name of the operator who ran the package and the time the package began and finished. For more information about it, please refer to: http://msdn.microsoft.com/en-us/library/ms140246.aspx And here is a similar thread, please refer to: http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/1ec9eb5f-2f95-43cb-b096-fcf06316fa32/ Thanks, Eileen
May 21st, 2012 4:57am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics