all groups > sql server dts > february 2004 >
You're in the

sql server dts

group:

How to check job status?


How to check job status? Tom Torain
2/20/2004 8:43:24 AM
sql server dts:
How to check SQL Agent job status by using VB Scripts
from command prompt?
Thanks for help.

Re: How to check job status? Allan Mitchell
2/20/2004 8:29:53 PM
you can use

SQL DMO
sp_help_job
sp_help_jobhistory

What do you mean by status?

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]

Re: How to check job status? Uwe Müller
2/23/2004 4:55:33 PM
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@discussions.microsoft.com> schrieb im Newsbeitrag
news:131cd01c3f7d0$a889d790$a101280a@phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button