Share via


Managing Packages and Folders Programmatically

As you work programmatically with Integration Services packages, you may want to determine whether an individual package or folder exists, or to manage the folders in which packages are stored. The Application class of the Microsoft.SqlServer.Dts.Runtime namespace provides a variety of methods to satisfy these requirements.

In This Topic

  • Determining whether a package or folder exists

  • Managing packages and folders

    • Removing a package

    • Creating a folder

    • Removing a folder

    • Renaming a folder

For information about enumerating available packages, see Enumerating Available Packages Programmatically. For information about loading and running saved packages programmatically, see Loading and Running a Local Package Programmatically and Loading and Running a Remote Package Programmatically.

All the methods discussed in this topic require a reference to the Microsoft.SqlServer.ManagedDTS assembly. After you add the reference in a new project, import the Microsoft.SqlServer.Dts.Runtime namespace with a using or Imports statement.

Important

The methods of the Application class for working with the SSIS Package Store support only ".", localhost, or the server name for the local server. You cannot use "(local)".

Determining Whether a Package or Folder Exists

To determine programmatically whether a saved package exists, call one of the following methods before attempting to load and run the package:

Storage Location

Method to Call

SSIS Package Store

ExistsOnDtsServer

SQL Server

ExistsOnSqlServer

To determine programmatically whether a folder exists, call one of the following methods before attempting to list the packages stored in the folder, :

Storage Location

Method to Call

SSIS Package Store

FolderExistsOnDtsServer

SQL Server

FolderExistsOnSqlServer

Back to top

Managing Packages and Folders

The Application class of the Microsoft.SqlServer.Dts.Runtime namespace provides additional methods for managing packages and the folders in which they are stored.

Removing a Package

To remove a saved package programmatically, call one of the following methods:

Storage Location

Method to Call

SSIS Package Store

RemoveFromDtsServer

SQL Server

RemoveFromSqlServer

Back to top

Creating a Folder

To create a storage folder programmatically, call one of the following methods:

Storage Location

Method to Call

SSIS Package Store

CreateFolderOnDtsServer

SQL Server

CreateFolderOnSqlServer

Back to top

Removing a Folder

To remove a storage folder programmatically, call one of the following methods:

Storage Location

Method to Call

SSIS Package Store

RemoveFolderFromDtsServer

SQL Server

RemoveFolderFromSqlServer

Back to top

Renaming a Folder

To rename a storage folder programmatically, call one of the following methods:

Storage Location

Method to Call

SSIS Package Store

RenameFolderOnDtsServer

SQL Server

RenameFolderOnSqlServer

Back to top

Integration Services icon (small) Stay Up to Date with Integration Services

For the latest downloads, articles, samples, and videos from Microsoft, as well as selected solutions from the community, visit the Integration Services page on MSDN or TechNet:

For automatic notification of these updates, subscribe to the RSS feeds available on the page.