SQl Agent Job

  • 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?

  • 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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