Solved

SQL SERVER 2008 sp_send_dbmail sending out duplicate emails

Posted on 2012-03-21
3
1,626 Views
Last Modified: 2012-08-27
I have a stored procedure that executes sp_send_dbmail to a variety of recipients.  It is scheduled to run at 4:00 AM and it successfully emails the text.  However, it duplicates the email and sends it EXACTLY 1 minute later.  The text in the email comes from a stored procedure but this stored procedure only runs a SELECT query (cursor).

Can someone help me figure out why this is duplicating the emails?  We recently upgraded to MS Exchange 2010.   I already looked at the advanced settings for the task and the retry attempts and retry interval are both set to zero (I seen that fixed the issue for someone else).

Thanks for the help.
0
Comment
Question by:PACCAST-DEV
3 Comments
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
ID: 37749862
You should trace the stored proc in my opinion to see if it is called more than once - use SQL profiler for that, and also check your set mail items in SQL by running query below to see if indeed duplicate mail was sent out:

select * from msdb..sysmail_sentitems order by sent_date desc
0
 

Author Closing Comment

by:PACCAST-DEV
ID: 37781946
Very helpful and tracked it down
0
 

Expert Comment

by:lhcit
ID: 38337378
What did you find it was doing?  I am having the same issue - I am going to start up sql profile and dig more, but thought I would check here too.  I see it in sysmail_mailitems with a status = 2 (failed), and I only see 1 record, but still receive the email twice, 1 minute apart.

Thanks!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now