views:

1574

answers:

1

I have an application where whenever a file is uploaded to a directory, I have to call SSIS to parse the XML file.

Can I call a SSIS directly from a .NET Windows service?

+7  A: 

Running SSIS package programmatically.

I prefer the second method:

Start DTEXEC.EXE process. DTEXEC is command line utility for executing SSIS packages. See its command line options here: http://msdn2.microsoft.com/en-us/library/ms162810.aspx

Benefits: running package out of process gains reliability. Can be used from any programming language (including .NET 1.1 :)). Easy to pass parameters by setting variables values.

Drawbacks: Also local only. Harder to get information about package progress (but SSIS logging can give you most functionality). Some overhead on starting new process (likely minimal compared to execution time for big packages).

ASP.NET specific: Win32 CreateProcess function ignores the thread impersonation. So if you want DTEXEC to run under account different from ASP.NET process account, you should either make user enter name/password and pass it to Process.Start, or use method described in the following KB to run child process under impersonated account http://support.microsoft.com/kb/889251.

Gulzar
Benefit of running the package within your service/.net app: You can pass objects to the variable collection of your package. (Try passing an object to dtexec...)
thijs