Solved

SQL SERVER 2008 sp_send_dbmail sending out duplicate emails

Posted on 2012-03-21
3
1,725 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 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

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

707 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