April 24, 2016 at 4:37 am
Hello folks,
I am looking for ideas or if anyone experienced the same before.
I have 1 step SQL Server 2012 job.
So it executes the Stored Proc with some convoluted logic and it outputs it to the text file(from Advanced->Output File)
If execution of the Stored Proc fails, the Stored proc is trying to send an email attaching the output file.
It cannot send it, because the output file is locked until the Step 1 (as well as Job) completes.
Creating Step 2 for failure notification, where I can send output file as an attachment won`t work for me because I will need to duplicate the half of the logic of the Stored Proc I use in step 1. Which doesn't make any sense.
Any other ideas on how to email the output of the job step-Stored Proc execution in one shot.
Thank you all
April 24, 2016 at 7:09 pm
inHouseDBA (4/24/2016)
Hello folks,I am looking for ideas or if anyone experienced the same before.
I have 1 step SQL Server 2012 job.
So it executes the Stored Proc with some convoluted logic and it outputs it to the text file(from Advanced->Output File)
If execution of the Stored Proc fails, the Stored proc is trying to send an email attaching the output file.
It cannot send it, because the output file is locked until the Step 1 (as well as Job) completes.
Creating Step 2 for failure notification, where I can send output file as an attachment won`t work for me because I will need to duplicate the half of the logic of the Stored Proc I use in step 1. Which doesn't make any sense.
Any other ideas on how to email the output of the job step-Stored Proc execution in one shot.
Thank you all
I might be missing something but why wouldn't you just make Step 1 branch to Step 2 if there was a failure and branch to Step 3 if there was no failure? It's pretty easy to do with the "On Success" and "On Failure" settings for each step.
--Jeff Moden
Change is inevitable... Change for the better is not.
April 24, 2016 at 9:05 pm
Actually thanks for reply, Jeff. As your reply helped me found a bug.
I need to revisit my code again.
April 24, 2016 at 9:10 pm
Can you send me few links, if any, on how to output the execution of stored proc to the text file?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply