Agent job and step name

  • Is there a way, from within an agent job, to programatically access both the job name and the step name of that job?

  • Yes, Google for "SQL Agent Tokens".

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • you can run this query and filter on the job_id

    SELECT * FROM dbo.sysjobsteps

    Ysaias Portes | Forward Thinkers Consulting
    sp_SQLFlightRecorder — open-source SQL Server diagnostic recorder | forwardthinkersconsulting.com

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply