You could parse the error log or you could programmatically loop through the
steps looking for the failure
Taken from
Execute a package from Visual Basic (VB)
(http://www.sqldts.com/default.aspx?208,1)
<SNIP>
For Each oStep In oPKG.Steps
If oStep.ExecutionResult = DTSStepExecResult_Failure Then
oStep.GetExecutionErrorInfo lErr, sSource, sDesc
sMessage = sMessage & "Step """ & oStep.Name & _
""" Failed" & vbCrLf & _
vbTab & "Error: " & lErr & vbCrLf & _
vbTab & "Source: " & sSource & vbCrLf & _
vbTab & "Description: " & sDesc & vbCrLf & vbCrLf
Else
sMessage = sMessage & "Step """ & oStep.Name & _
""" Succeeded" & vbCrLf & vbCrLf
End If
Next
</SNIP>
--
--
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Scubafrog67" <scuba79 (AT) spammeanddie (DOT) bellsouth.net> wrote
Quote:
I'm using email to notify if a package is successful or
failed. How can I add into the email what step of the DTS
package failed so I have an idea where to start looking?
Thanks in advance |