共用方式為


Package.GetBreakpointTargets Method

Returns a BreakpointTargets collection. Depending on the setting of the onlyEnabled parameter, the collection contains all breakpoint targets in the package, or only enabled breakpoint targets.

命名空間: Microsoft.SqlServer.Dts.Runtime
組件: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

語法

'宣告
Public Function GetBreakpointTargets ( _
    bpSite As IDTSBreakpointSite, _
    onlyEnabled As Boolean _
) As BreakpointTargets
public BreakpointTargets GetBreakpointTargets (
    IDTSBreakpointSite bpSite,
    bool onlyEnabled
)
public:
BreakpointTargets^ GetBreakpointTargets (
    IDTSBreakpointSite^ bpSite, 
    bool onlyEnabled
)
public BreakpointTargets GetBreakpointTargets (
    IDTSBreakpointSite bpSite, 
    boolean onlyEnabled
)
public function GetBreakpointTargets (
    bpSite : IDTSBreakpointSite, 
    onlyEnabled : boolean
) : BreakpointTargets

參數

  • onlyEnabled
    A Boolean that indicates what type of breakpoint targets to include in the collection. true indicates that only enabled breakpoints are included in the collection, false indicates that all breakpoint targets are included in the collection.

傳回值

A BreakpointTargets collection.

備註

The onlyenabled parameter, when set to true, checks the value of the Enabled property and includes those breakpoints with an Enabled set to true.

Integration Services (SSIS) supports breakpoints on containers and tasks. The Business Intelligence Development Studio provides debug windows, and the SSIS Designer provides progress reporting for debugging package control flow. SSIS Designer provides the Set Breakpoints dialog box where you can enable breakpoints and set the number of times a breakpoint occurs before the runtime engine stops running. If task breakpoints are enabled, the breakpoint icon appears next to the task on the design surface of the Control Flow window. You can set breakpoints to occur on events. For more information about setting breakpoints on events, see Integration Services 事件處理常式.

範例

The following code samples shows how to use the GetBreakpointTargets to get the collection of breakpoints in the package.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks.BulkInsertTask;

namespace Breakpoint_API
{
    class Program
    {
        static void Main(string[] args)
        {
            Package pkg = new Package();
            TaskHost taskHost = (TaskHost)pkg.Executables.Add("STOCK:FileSystemTask");
            BreakpointTargets bptargets = pkg.GetBreakpointTargets(taskHost, false);
            foreach (BreakpointTarget bpt in bptargets)
            {
                Console.WriteLine("BreakOnExpressionChange? {0}", bpt.BreakOnExpressionChange.ToString());
                Console.WriteLine("Description              {0}", bpt.Description);
                Console.WriteLine("Enabled?                 {0}", bpt.Enabled);
                Console.WriteLine("HitCount                 {0}", bpt.HitCount);
                Console.WriteLine("HitTarget                {0}", bpt.HitTarget);
                Console.WriteLine("HitTest                  {0}", bpt.HitTest);
                Console.WriteLine("ID                       {0}", bpt.ID);
                Console.WriteLine("Owner                    {0}", bpt.Owner);
            }
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.BulkInsertTask
 
Namespace Breakpoint_API
    Class Program
        Shared  Sub Main(ByVal args() As String)
            Dim pkg As Package =  New Package() 
            Dim taskHost As TaskHost = CType(pkg.Executables.Add("STOCK:FileSystemTask"), TaskHost)
            Dim bptargets As BreakpointTargets =  pkg.GetBreakpointTargets(taskHost,False) 
            Dim bpt As BreakpointTarget
            For Each bpt In bptargets
                Console.WriteLine("BreakOnExpressionChange? {0}", bpt.BreakOnExpressionChange.ToString())
                Console.WriteLine("Description              {0}", bpt.Description)
                Console.WriteLine("Enabled?                 {0}", bpt.Enabled)
                Console.WriteLine("HitCount                 {0}", bpt.HitCount)
                Console.WriteLine("HitTarget                {0}", bpt.HitTarget)
                Console.WriteLine("HitTest                  {0}", bpt.HitTest)
                Console.WriteLine("ID                       {0}", bpt.ID)
                Console.WriteLine("Owner                    {0}", bpt.Owner)
            Next
        End Sub
    End Class
End Namespace

Sample Output:

BreakOnExpressionChange? False

Description Break when the container receives the OnPreExecute event

Enabled? False

HitCount 0

HitTarget 0

HitTest Always

ID -2147483647

Owner Microsoft.SqlServer.Dts.Runtime.TaskHost

執行緒安全性

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

Package Class
Package Members
Microsoft.SqlServer.Dts.Runtime Namespace