1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| <%
Const DTSSQLStgFlag_Default = 0
Const DTSStepExecResult_Failure = 1
Dim oPkg, oStep, sMessage, bStatus
Set oPkg = Server.CreateObject("DTS.Package2")
oPkg.LoadFromSQLServer "monserver","login","passwd", DTSSQLStgFlag_Default,"","","","DTSDemo"
oPkg.Execute()
bStatus = True
For Each oStep In oPkg.Steps
sMessage = sMessage & "<p class=""StandardBody"" align=""center""> Step [" & oStep.Name & "] "
If oStep.ExecutionResult = DTSStepExecResult_Failure Then
sMessage = sMessage & " failed<br>"
bStatus = False
Else
sMessage = sMessage & " succeeded<br>"
End If
sMessage = sMessage & "Task """ & oPkg.Tasks(oStep.TaskName).Description & """</p>"
Next
If bStatus Then
sMessage = sMessage & "<p class=""StandardBody"" align=""center"">Package [" & oPkg.Name & "] succeeded</p>"
Else
sMessage = sMessage & "<p class=""StandardBody"" align=""center"">Package [" & oPkg.Name & "] failed</p>"
End If
Response.Write sMessage
%> |
Partager