Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8082951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:17:36+00:00 2026-06-05T17:17:36+00:00

Is there any way to identify which SQL Agent job is running a stored

  • 0

Is there any way to identify which SQL Agent job is running a stored procedure?

The reason I want this is that I’d like to have a separate step, that runs on failure, that has a stored procedure which will email the log file. To get the log file (we always use only one log file per job, not per step), I’d like to just be able to get the log file by querying the MSDB tables (select output_file_name from sysjobsteps).

I could pass a parameter with the job name to the stored procedure, but I’d like to not need to do that.

Any ideas?

thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:17:39+00:00Added an answer on June 5, 2026 at 5:17 pm

    Do you mean which job is calling the logging procedure? ie who is calling me is that what you mean? if thats the case then this may be relevant… SQL Server Agent – get my own job_id .. the failure step where you post your logging proc could use the jobid retrieved by the method described in the link… imho would work.. youd need to add a job id parm though.. and each failure step in each job
    would have to have two lines… one to get the id and one to call the proc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way in SSIS to identify which particular task has failed? My
Is there any way by using JDT ASTParser, by which we can identify if
I want to drop all the SQL Agent Jobs which are not currently running
Is there any way to identify the modified image with PIL in python? My
Is there any way to uniquely identify controls using Accessibility? Once control is identified
Is there any way that I can create a new delegate type based on
I have a plugin which is applied on few element. Is there any way
Is there a way in LINQ to Entities (SQL) to identify all records where
Is there any way to identify if iPhone supports CDMA or GSM network. Any
Is there any way to change the BackColor of the border of a panel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.