I have scheduled sql agent task which runs an SSIS package. I want to be able to run the SSIS package from .net. Is there a way to either run the SSIS package directly or at least run the SQL agent task which would in turn run the SSIS package.
If it helps it is for a .net 3.5 web app written in C#
Thanks!
However, if you are asking can you execute SSIS packages without LICENSING SQL Server Database Engine, the answer is NO. If you use SSIS, you must have a license on the server.
Description: To run a SSIS package outside of SQL Server Data Tools you must install Enterprise Edition of Integration Services or higher.
The SSIS catalog is not supported by the command-line tool DTExecUI. There are windows in SSMS for running the packages in the catalog. Your other options are SQL Server or the File System. With the SQL Server option, you will see only packages stored in the MSDB of the server that you name.
The options that are available to run a SSIS package are -
An Example:
using System;
using Microsoft.SqlServer.Dts.Runtime;
namespace RunFromClientAppCS
{
class Program
{
static void Main(string[] args)
{
string pkgLocation;
Package pkg;
Application app;
DTSExecResult pkgResults;
pkgLocation = "<package path>\CalculatedColumns.dtsx";
app = new Application();
pkg = app.LoadPackage(pkgLocation, null);
pkgResults = pkg.Execute();
Console.WriteLine(pkgResults.ToString());
Console.ReadKey();
}
}
}
Start DTEXEC.EXE process. DTEXEC is command line utility for executing SSIS packages. See its command line options here.
Use SQL Agent. You can configure an Agent job to run your package (either do it manually in advance if the package is static, or programmatically using SMO or using SQL stored procedures just before running the package), and then start it programmatically using SMO or sp_start_job.
Use some other utility to start DTEXEC for you.
Create a custom application that will run the package (either using OM as described in method #1, or using DTEXEC as in method #2). Expose it as a web service or DCOM class, call this service from your program.
Invent your own :)
Reference: Running SSIS Package Programmatically
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With