Database Reference
In-Depth Information
We begin at the heart of execution control with the parent-child pattern. You need to
start by creating a new SSIS solution and project named
SSISConfig2014
. Rename
the default
Package.dtsx
to
Child1.dtsx
. Open the Child1 SSIS package and
add a Script task to the control flow. Rename the Script task
Who Am I?
and open the
Script task's editor. On the Script page, set the ScriptLanguage property to Microsoft
Visual Basic 2012. Click the ellipsis in the ReadOnlyVariables property value textbox
and add the
System::TaskName
and
System::PackageName
variables. Open
the script editor and add the following code in
Sub Main()
.
Listing A-1
.
Sub Main from Who Am I? Script Task in Child1.dtsx Package
Public Sub Main()
Dim sPackageName As String
= Dts.Variables("PackageName").Value.ToString
Dim sTaskName As String
= Dts.Variables("TaskName").Value.ToString
MsgBox("I am " & sPackageName, , sTaskName)
Dts.TaskResult = ScriptResults.Success
End Sub
The code shown in
Listing A-1
pops up a message box that informs an observer of
the name of the package from which the message box originates. This is reusable code.
You can copy and paste this Script task into any SSIS package and it will perform the
same way each time.
Now close the editor and execute the
Child1.dtsx
package in the SSDT debug-
ger. When I execute the package, I see a message box similar to the one shown in
Fig-
Search WWH ::
Custom Search