Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 SQL Agent email notification

Author  Topic 

Hommer
Aged Yak Warrior

808 Posts

Posted - 2014-05-21 : 09:52:11
Hi,

I am trying to figure this out, and need your help.

In this case, SQL agent sends email notification to me when it should not.

In SQL 2012 enterprise, I created this update stats maintenance plan job from SSMS.

First, I have set it up to send notification when complete.
It worked.

Then, I changed it to notify when it failed.

However, I am still receiving emails even it succeeded.

Even after I removed the notification all together and restart the agent, the email still faithfully arrive!

I saw it in here

use msdb
go

select * from dbo.sysmaintplan_plans pln
join dbo.sysmaintplan_subplans spln on pln.id = spln.plan_id
join dbo.sysjobs job on spln.job_id = job.job_id
where pln.name ='Update statistics'

and here
Select * FROM [dbo].[sysmail_mailitems]

As you can tell, it is not a major issue, but it bothers me in a production box, that it acts the way it is not supposed to.

I understand some of you have said maintenance plan is not good in many regards.

Thanks!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-05-21 : 12:22:14
I would delete the maintenance plan and then set it up again. Alternatively, you can roll your own update stats job.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -