Showing posts with label SSIS. Show all posts
Showing posts with label SSIS. Show all posts

Monday, March 24, 2008

Running SSIS packages under other Users

There is one place need your very special attention when you try to deploy SSIS package, and let other users run the package. That is "Package Protection Level". By default it chooses "Encrypt sensitive data with user key". That is why you can't run it under the other users' account. Maybe you can try to use "Rely on server storage and roles for access control".

Sunday, March 23, 2008

Running SSIS package programmatically

Here I found a nice blog post for Running SSIS package programmatically. Sql Server Integration Service is still a little bit confusing. Not just like you can easily run some SSIS packages on remote DB server which most likely every DBA dreaming for that. You need to use SQL Agent or do some programming of Web Service to run it.


Monday, March 03, 2008

Execute SSIS Package in C# Apps

Add referrence to Micosoft.SQLServer.ManagedDTS.dll. It is in your SQL Server Program Files Folder\SDK\Assemblies.

using Microsoft.SqlServer.Dts.Runtime;

namespace ExecuteSSIS
{
class Program
{
static void Main(string[] args)
{
Application app = new Application();
//
// Load package from file system
//
Package package = app.LoadPackage(@"c:\myPackage.dtsx", null);
package.ImportConfigurationFile(@"c:\myPackage.dtsConfig");
//Pass parameters
Variables vars = package.Variables;
vars["variable"].Value = "values";
DTSExecResult result = package.Execute();
Console.WriteLine("Package Execution results: {0}",result.ToString());

//
// Load package from Sql Server
//
Package package2 = app.LoadFromSqlServer(
"myPackage","server_name", "sa", "password", null);
package2.ImportConfigurationFile(@"c:\myPackage.dtsConfig");
//Pass parameters
Variables vars2 = package2.Variables;
vars2["variable"].Value = "value";
DTSExecResult result2 = package2.Execute();
Console.WriteLine("Package Execution results: {0}",
result2.ToString());
}
}
}