?
Solved

SQL SERVER 2008 sp_send_dbmail sending out duplicate emails

Posted on 2012-03-21
3
Medium Priority
?
1,750 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 40

Accepted Solution

by:
lcohan earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

762 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