Maintenance Plan - Send Mail

  • Hi All,

    I am stumped. I have a query which runs fine on it's own. It generates data. I have made a Weekly Maintenance plan which is to run on Monday mornings. Today all of my logging says that the plan executed, however, there was no email that was sent. I checked the history for the plan, and it ran fine, I also checked the application event log, I can see the plan starting and completing successfully.

    I have verified that there is data to be sent out. And checked the email addresses that it is to be going to. All is fine.

    Last week I ran windows updates, and rebooted my SBS 2003 R2 server, before the updates the email sent fine.

    I am not sure what else to check.

  • If this is not a maintenance task - then you really shouldn't put it in a maintenance plan. You should just setup an agent job and run it from there.

    In the maintenance plan, how are you setting it up to email?

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • I honestly have no idea why it was set up as a Maintenance plan. The plan is meant to run some T-SQL.

    DECLARE @rc int

    -- TODO: Set parameter values here.

    EXECUTE @rc = [BRE_DB].[dbo].[admin_Weekly_Cost_Summary]

    admin_weekly_Cost_Summary goes to our database and gets the email address's and then runs a table valued function to get the data to send to each client email. It creates a xls attachment for the data.

    How do I go about setting up an agent??

  • Under SQL ServerAgent, create a new job, then paste your code into a new step within the job. Create a notification to alert you if it fails, then schedule it to run at whatever interval you want (daily, weekly etc...)

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

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