偵錯指令碼Debugging Script

您可以撰寫指令碼工作和指令碼元件在 MicrosoftMicrosoft Visual StudioVisual Studio Tools for Applications (VSTA) 中使用的指令碼。You write the scripts that the Script task and Script component use, in MicrosoftMicrosoft Visual StudioVisual Studio Tools for Applications (VSTA).

您可以在 VSTA 中設定中斷點和編寫中斷點指令碼。You set and script breakpoints in VSTA. 您可以在 VSTA 中管理中斷點,但您也可以使用「 SSISSSIS 設計師」提供的 [設定中斷點] 對話方塊管理中斷點。You can manage breakpoints in VSTA, but you can also manage the breakpoints using the Set Breakpoints dialog box that SSISSSIS Designer provides. 如需詳細資訊,請參閱偵錯控制流程For more information, see Debugging Control Flow.

[設定中斷點] 對話方塊包含指令碼中斷點。The Set Breakpoints dialog box includes the script breakpoints. 這些中斷點出現在中斷點清單的底部,並顯示中斷點所在之函數的行號和名稱。These breakpoints appear at the bottom of the breakpoint list, and display the line number and the name of the function in which the breakpoint appears. 您可以從 [設定中斷點] 對話方塊刪除指令碼中斷點。You can delete a script breakpoint from the Set Breakpoints dialog box.

在執行階段,於指令碼中程式碼行上設定的中斷點會與封裝上或封裝的工作和容器上設定的中斷點整合。At run time, the breakpoints set on lines of code in script are integrated with the breakpoints set on the package or the tasks and containers in the package. 偵錯工具可以從指令碼中的中斷點執行到封裝、工作或容器上設定的中斷點,反之亦可。The debugger can run from a breakpoint in the script to a breakpoint set on the package, task, or container, and vice versa. 例如,封裝可能具有以封裝接收到 OnPreExecuteOnPostExecute 事件時發生之中斷條件設定的中斷點,而且封裝還可擁有在其指令碼行上具有中斷點的指令碼工作。For example, a package might have breakpoints set on the break conditions that occur when the package receives the OnPreExecute and OnPostExecute events, and also have a Script task that has breakpoints on lines of its script. 在此案例中,封裝可以暫停與 OnPreExecute 事件相關之中斷條件的執行,而執行到指令碼中的中斷點,並最終執行到與 OnPostExecute 事件相關的中斷條件。In this scenario, the package can suspend execution on the break condition associated with the OnPreExecute event, run to the breakpoints in the script, and finally run to the break condition associated with the OnPostExecute event.

如需偵錯指令碼工作和指令碼元件的詳細資訊,請參閱 指令碼工作的程式碼撰寫和偵錯指令碼元件的程式碼撰寫和偵錯For more information about debugging the Script task and Script component, see Coding and Debugging the Script Task and Coding and Debugging the Script Component.

在 Visual Studio for Applications 中設定中斷點To set a breakpoint in Visual Studio for Applications

另請參閱See Also

疑難排解封裝開發的工具Troubleshooting Tools for Package Development