Prevent parellel execution of SSIS package

Posted on 2011-04-20
Medium Priority
Last Modified: 2013-03-13
We have a SSIS package that we need to prevent from being run more than once at any given time.  The package can be executed sequentially, but cannot be executed in parallel.  It doesn't matter how the package is called, if an instance of the package is already executing the next time execution is triggered it needs to either, wait (queue up the execution) or return an error that execution is already in progress.

We need some way of enforcing this.

The package can be called from multiple sources:
Triggered from a web application
Called directly from SQL Server
Question by:mrichmon

Accepted Solution

jijeesh earned 2000 total points
ID: 35435681
You can track it in a database table. When you start processing the package set a flag  (say  "IsRunning")  in database and once you finish running reset it. Also be carefully handle the flag on exceptions.

Expert Comment

ID: 35435686
There is a property called "MaxConcurrentExecutables" for a package.

For more info

LVL 35

Author Comment

ID: 35437291

Yes that is the only way we came up with so far too...  Thanks for the suggestion.

That sounded neat, but reading the article it limits concurrent tasks within a package - not concurrent executions of the entire package....
LVL 43

Expert Comment

by:Eugene Z
ID: 35454201
you probably needf to change the way how you call the ssis pack
you can try to wrap it as .NET application
and try to get GUID, and or logging to check if status is running , etc

Execute Package Task

Integration Services: Performance Tuning Techniques

LVL 35

Author Comment

ID: 35460628

>>you probably need to change the way how you call the ssis pack
We need a solution that is independent of how the package is called

The links you posted are for tuning a package - the package is fine - it just can't be run more than once at a time based on the resources it needs to use.  We want the second execution to either a) queue up the request to run and run once the previous package run is complete or b) report back an error as in "can't be called now, please try again"

For some reason, locking resources isn't sufficient - they are locked and when the second execution tries to access them it hangs up the first execution - instead of just the second one not working or timing out...

So we need to actually prevent the second, third, etc. calls until the prior one is complete.

The only thing we came up with is like jijeesh mentioned, having the package run status in a table.  Then the first step of the package is to read that table to find out if it is "okay" to run.  This prevents the multiple run, but would have to return the error - we aren't sure how to use that technique to queue up the request to run...

As a note, this package takes about 40 minutes to run in one configuration (that goes nightly) and about 2 minutes to run during all other calls (on a much smaller population).  It is more a concern of queuing the short runs - since those are user triggered, the nightly run is scheduled...


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question