Database Reference
In-Depth Information
Public Sub Main()
Dim sPackageName As String
= Dts.Variables("PackageName").Value.ToString
Dim sTaskName As String
= Dts.Variables("TaskName").Value.ToString
Dim sSubComponent As String = sPackageName & "."
& sTaskName
Dim sApplicationName As String
= Dts.Variables("ApplicationName").Value.ToString
Dim iAppInstanceID As Integer = _
Convert.ToInt32(Dts.Variables("AppInstanceID").Value)
Dim sMsg As String = "ApplicationName: " &
sApplicationName & vbCrLf & _
"AppInstanceID: " &
iAppInstanceID.ToString
Dts.Events.FireInformation(1001, sSubComponent,
sMsg, "", 0, True)
Dts.TaskResult = ScriptResults.Success
End Sub
The purpose of the script is the Dts.Events.FireInformation call near the
end. The first argument for this function is the InformationCode . Depending on
the nature and purpose of the SSIS framework, I may or may not enter a value (other
than 0 ) here. The SubComponent argument is next and I usually construct a string
identifying the names of the package and task. The description argument follows, and
this contains the message I want to inject into the log.SSISEvents table. The next
two arguments are help-related—I usually blank and zero them, respectively. The last
argument is FireAgain , and I am uncertain if it does anything (anymore); I always
set it to True .
Close the script editor and the Script Task Editor. Connect a precedence constraint
from the Log Start of Application Execute SQL task to the Log Application Variables
Script task and another precedence constraint from the Log Application Variables
Script task to the Get Package Metadata Execute SQL task.
Drag another Script task into the Foreach Child Package Foreach Loop container
and rename it Log Package Variables . Open the editor and change the ScriptLanguage
Search WWH ::




Custom Search