共用方式為


Managing Running Packages Programmatically

新增: 2006 年 7 月 17 日

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 管理 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(zh-tw,SQL.90).gif重要事項:
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.

Aa337075.note(zh-tw,SQL.90).gif附註:
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.

請參閱

工作

Enumerating Available Packages Programmatically

其他資源

管理 Integration Services 封裝

說明及資訊

取得 SQL Server 2005 協助