question

eghetto avatar image
eghetto asked

Who stopped (canceled) my SQL Server Agent Job?

Dear All, in my job (step) history a can see the following statement: ***"Executed as user: XX\\yyyy. The step was cancelled (stopped) as the result of a stop job request."*** Is there a way to find out who stopped this job? Thanks!
sql-server-2008-r2sql-agentjobjob-history
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
tanglesoft avatar image
tanglesoft answered
If you view the job history from SSMS in the message it will say 'The job was stopped prior to completion by user xxx.'
8 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

The information is recorded in msdb..sysjobhistory also
0 Likes 0 ·
Thanks - piece of code?
0 Likes 0 ·
select message,* from msdb..sysjobhistory hope it may help to you by www.sqltechi.blogspot.in
0 Likes 0 ·
If you execute select
0 Likes 0 ·
sorry, but the message column just contains "Executed as user: XX\yyyy. The step was cancelled (stopped) as the result of a stop job request." There is no information about the user who canceled the job. Or am I missing something...?
0 Likes 0 ·
select top 1 message from msdb.dbo.sysjobs job join msdb.dbo.sysjobhistory history on job.job_id = history.job_id where name = 'YourJobName' order by run_date, run_time desc
0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.