Reputation: 531
I have a job in SQL server Agent. Now I see that this job is disabled. Multiple people can log in to server and can modify jobs (department policy).
I want to find out which user disabled this job.
Upvotes: 3
Views: 12623
Reputation: 5940
Time of the change is the only information you can query by default
SELECT date_modified FROM dbo.sysjobs
WHERE job_id = 'job_id'
In order to capture more information following measures can be setup ahead on sysjobs:
Nice example: SQL Server Agent logging actions and changes done to jobs
Another one:
create trigger trigg on msdb.dbo.sysjobs
after insert , update
as
EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'name_of_mail_profile',
@recipients = '[email protected]',
@body = 'New job creation or job modification alert',
@subject = 'Automated Message' ;
Upvotes: 7