Showing posts with label extracts. Show all posts
Showing posts with label extracts. Show all posts

Wednesday, March 7, 2012

How to launch package from a Windows Service

I'm developing a Windows Service to watch for an e-mail and then launch a package. It extracts some parameters from the e-mail that I then need to pass to the package. What is the best way to launch the package from the service? Should I run it in a new thread? I don't want the service to have to wait for the package to complete. How would I pass the parameters? Should I use dtexec? If the service fails or is stopped and the package is still running, it would terminate the package also, correct? Any way to avoid that? Thanks.Running the package inside the service process is faster, as you avoid overhead of creating new process per package. But running in DTEXEC gives you process isolation and reliability - the service stop or crash does not affect executing packages, and crash in one package execution does not affect other packages.

In both cases I would pass parameters via user variables. If you execute in process, you can set the variable using object model before executing. If you use DTEXEC, use /SET command line option to configure variables.|||Thanks Michael.