Run Deployed SSIS Package thorough remote computer under WinForms

I have a couple of packages deployed on SQL Server 2008.

I want to run them through data process team, when they got a signal from QA that the data is ok, then they hit a button in Winforms application, which check for some stuff, if find ok then start process on that server. Please note that these Packages are deployed on a remote SQL instance.

I have this code, this will probably work fine for a package on a local computer as well as on file system. Please provide me some help so that my remotely deployed packages can run on winform applications.

string pkgLocation = @"c:\test.dtsx";

Package pkg;

Microsoft.SqlServer.Dts.Runtime.Application app;

DTSExecResult pkgResults;

Variables vars;

app = new Application();

pkg = app.LoadPackage(pkgLocation, null);

vars = pkg.Variables;

vars["A_Variable"].Value = "Some value";

pkgResults = pkg.Execute(null, vars, null, null, null);

if (pkgResults == DTSExecResult.Success)

    Console.WriteLine("Package ran successfully");

else

    Console.WriteLine("Package failed");

Upvotes: 0

Views: 681

Answers (1)

Goody
Goody

Reputation: 406

I would approach this by deploying the packages into SQL jobs and then using SQL Managment Objects for this task

http://msdn.microsoft.com/en-us/library/ms162202.aspx

http://www.sqldbatips.com/showarticle.asp?ID=34

Upvotes: 1

Related Questions