locked
how to find which sql job is calling other jobs ? RRS feed

  • Question

  • Hi ,

    Is there a way to find a parent child relationship for sql jobs too ?

    Meaning, how can I get what all jobs are being called in a particular job etc ? I have 241 jobs on my server. I need to document those.

    Thanks in Advance

    Ram

    Tuesday, January 20, 2015 9:07 PM

Answers

  • Please check below post that I did in

    MSDB Jobs Detail Information


    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

    • Marked as answer by ABCD0008 Wednesday, January 21, 2015 3:46 AM
    Tuesday, January 20, 2015 9:34 PM

All replies

  • Run this query on msdb and search for your child job name.

    SELECT J.name, S.command  FROM sysjobsteps S
    INNER JOIN sysjobs J ON S.job_id = J.job_id
    WHERE s.command LIKE 'exec msdb.dbo.sp_start_Job%' or s.command LIKE '%exec msdb.dbo.sp_start_JOb%'

    Tuesday, January 20, 2015 9:23 PM
  • Please check below post that I did in

    MSDB Jobs Detail Information


    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

    • Marked as answer by ABCD0008 Wednesday, January 21, 2015 3:46 AM
    Tuesday, January 20, 2015 9:34 PM
  • See also this blog post by Brad Schulz

    http://bradsruminations.blogspot.com/2011/04/documenting-your-sql-agent-jobs.html


    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog


    My TechNet articles

    Tuesday, January 20, 2015 10:26 PM
  • Thanks  a lot Arbi .. your code helped me a lot .. Already implemented your code on our production box .. Thanks again 
    Wednesday, January 21, 2015 3:45 AM
  • Thanks Naomi .. Very useful code but the one Arbi posted was much close to what I am looking for .. thanks for your reply 

    Ramesh

    Wednesday, January 21, 2015 3:46 AM
  • http://shamas-saeed.blogspot.com/2012/04/sql-agent-job-detail-report-information.html

    This might help in your problem.


    Shamas Saeed (if Post helpful please mark as Answer) http://shamas-saeed.blogspot.com

    Wednesday, January 21, 2015 8:38 AM