Hi Tom
take that vb sample (with rdo, can be changed to ado)
Set rs = rc.OpenResultset("msdb.dbo.sp_help_jobserver @job_name =
'speed_daten_holen', @show_last_run_details = 1")
If Not rs.EOF Then
If rs.rdoColumns(4) < CLng(Format(Date, "yyyymmdd")) _
Or (rs.rdoColumns(4) = CLng(Format(Date, "yyyymmdd") _
And rs.rdoColumns(5) < starttime)) Then Exit Sub
If rs.rdoColumns(7) = "1" Then
MsgBox "all ok"
Else
Select Case rs.rdoColumns(7)
Case "0"
f = "job closed with error"
Case "3"
f = "job aborted"
Case Else
f = "unknown error"
End Select
MsgBox f
End If
End 'programm beenden
End If
hope this helps
Uwe
"Tom Torain" <anonymous (AT) discussions (DOT) microsoft.com> schrieb im Newsbeitrag
news:131cd01c3f7d0$a889d790$a101280a (AT) phx (DOT) gbl...
Quote:
How to check SQL Agent job status by using VB Scripts
from command prompt?
Thanks for help.
-Tom |