October 27, 2010 at 5:34 am
How can i find who shcdueld a sql job ?
The reason i am asking is we have 3 sysadmin on a sql box and so would like to know who exactly did that?
October 27, 2010 at 5:52 am
the easiest way is to ask the other admins "hey did you create that job?"
I just created a job on purpose, and it does not appear in the default trace.
i looked at the table msdb.sys.jobs, and it has an owner id, so i figure this gets you pretty close:
/*--results
LoginName JoBName owner_sid
myDomain\Lowell PR_CAPTURESP_WHO 0x0105000000000...
myDomain\Lowell My DML Trace 0x0105000000000...
myDomain\Lowell CDW_DBSQL2K5_D223_1 0x0105000000000...
*/
select
loginz.name as LoginName,
jobz.name as JoBName,
jobz.owner_sid from msdb.dbo.sysjobs jobz
inner join master.sys.server_principals loginz
ON jobz.owner_sid = loginz.sid
Lowell
October 27, 2010 at 5:59 am
Actually i created that job some time back but i did not schduleed it some one else has shcduled yesterday which messed up a database. I would look to pull out the id that schduled the job.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply