Run query every time a SQL Server Agent job runs -


i have around 100 sql server agent jobs run on schedules. need way execute query , dump results every time 1 of jobs runs table.

[job name], [success/fail], [time] etc.  

the table custom table can flexible it. google has turned answers in wrong directions.

why not check log file sql server agent?

view sql server agent error log

enter image description here

you can manually query dbo.sysjobhistory and/or dbo.sysjobactivity:

dbo.sysjobhistory

contains information execution of scheduled jobs sql server agent. table stored in msdb database.

dbo.sysjobactivity

records current sql server agent job activity , status.

select * msdb.dbo.sysjobhistory 

and

select * msdb.dbo.sysjobactivity 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -