I have two steps in each of my SQL Agent jobs - one called if a job step fails, another if it succeeds.
Each step utilizes sp_send_dbmail to send an email notification.
On the successful completion step, I would like to include the job's total run-time in the body of the email sent.
How can I determine total run-time (or more accurately current run-time) for the job and send via sp_send_dbmail in the body of the email?
Thanks.