Managing Running Packages Programmatically

Data creazione: 17 luglio 2006

As you work programmatically with Integration Services packages, you may want to determine which packages are currently running. The Application class of the Microsoft.SqlServer.Dts.Runtime namespace provides methods and classes to satisfy these requirements.

For more information about monitoring packages, see Gestione dei pacchetti di Integration Services.

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.

Aa337075.note(it-it,SQL.90).gifImportante:
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 Which Packages Are Currently Running

To determine which packages are currently running on the specified server, call the GetRunningPackages method. This method returns a RunningPackages collection of RunningPackage objects.

[!NOTA] Administrators see all packages that are currently running on the computer; other users see only those packages that they have started.

Working with Running Packages

After you have determined which packages are currently running, you can retrieve information about the packages and request that a package be stopped.

Getting Information about a Running Package

As you iterate through the RunningPackages collection, you can use the properties of the RunningPackage object to locate a package or to obtain additional information about the packages that are running:

Stopping a Running Package

You can call the Stop method of a RunningPackage object to request that the package be stopped. There may be a delay between the time that a stop request is issued and the time that the package actually stops.

Vedere anche

Attività

Enumerating Available Packages Programmatically

Altre risorse

Gestione dei pacchetti di Integration Services

Guida in linea e informazioni

Assistenza su SQL Server 2005