Sending Email From a Stored Procedure

  • Our database tracks scheduled jobs in a table in the database. I have written a Stored Proc that would run hourly that retrieves the status of the job that was run, which is scheduled to run every 15 minutes. If the return code is not Complete-Good, I want to send an email. I have found the xp_SendMail SP, but am not sure how to make SQL Server 2005 send it. From what I have seen, the Surface Area Configuration for Features needs to be set up so I can execute the xp_SendMail SP. Is that correct?

  • That would be true. However, I would highly recommend that you use sp_send_dbmail since you are in 2005. You can find great resources on configuring Database Mail HERE.

    Hope this helps.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

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

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