Notify multiple operators

  • Thank you all for your support

    M&M

  • Notify multiple operators with difference results

    https://sqlhiker.com/2016/07/09/notify-multiple-operators-with-difference-results/[/url]

  • 🙂

  • If sending the email with the attachment is not the first step in your job, any previous steps that interacted with that file have a 'lock' on it.

    This is why it works when called as a standalone execution.

    Message

    Executed as user: NT AUTHORITY\SYSTEM. Failed to open attachment file 'Drive:\Path\FileName'. Executing API 'CreateFile' failed with error number 32. [SQLSTATE 42000] (Error 22051). The step failed.

    After hours of trying permissions on the folder, setting the agent to run as the local service account etc etc I finally moved the email step into its own job. In the previous job, I just changed the last step to call the 'email' job:

    [font="Arial Black"]EXECUTE msdb.dbo.sp_start_job 'Name of Email Job'[/font]

    Worked like a charm once then failed for same error next run.

Viewing 4 posts - 16 through 18 (of 18 total)

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