Today, we will build a simple executable that will open the test package. For testing purposes, as well as for many scheduling utilities, we will be building a command line executable. The executable will accept the package path as an input parameter. Other features will be added in later days, but today we are starting small.
The first step is to create a console application in Visual Studio named SSISRunner.
Visual Studio does not automatically create references to the required DLL’s for this solution. You will need to manually add a reference to Microsoft.SQLServer.DTSRuntimeWrap which was located in C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies\ Microsoft.SQLServer.ManagedDTS.dll on my machine. The easiest way to ensure that all required components are available on your machine is to install the version of SQL server that you wish to target and include the SDK.
Once referenced, you can use it your program:
Now, the easy part. Since the package is saved as file, opening the package is a simple call to Application.LoadPackage. Your code should look similar to this:
static void Main(string args)
string PackagePath = “”
Application app = new Application();
//Get the path from the command line arguments
PackagePath = args.ToString();
catch (Exception EX)
Console.WriteLine(“USAGE: SSISRunner <PackagePath>”);
//Open the package
if (PackagePath != “”)
pkg = app.LoadPackage(PackagePath, null);
Build the application by pressing F6. This will create the executable in the C:\DOC\SSISRunner\SSISRunner\bin\Debug directory. This portion of the process can be the most confusing part. I am not an expert on Visual Studio or .Net. Assistance from professionals more knowledgeable than myself (of which there are many) may be required to get the application to compile for the first time. Now the good news: once the application compiles and is able to execute without errors, the rest will be easy.