Controlling Agent jobs from T-Sql

  • I can start an agent job using the command :

    msdb..sp_start_job @job_name = 'My Agent Job'

    Does anyone know how I can see if a particular job is running, and maybe even find out if the last run was successful or not?

    Thanks.

    Rick Jewson


    Rick Jewson

  • In SQL Server 2000 i use to query on sysjobs, sysjobhistory tables and find when it was last rum ,or whether the job i s already running and whether it ran successfully or not, find out more in BOl for sysjobhistroy table... in msdb database...

    I hope this helps..

    Bye

    Jay

  • You can use sp_help_job to view status of your own jobs if you are not the member of sysadmin.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply