none
Purging ExternalMailQueue RRS feed

  • Question

  • How do I go about purging the items queued up in the ExternalMailQueue on SQL Server 2005? I have not been able to find any documentation on this. I can not delete directly against this queue via sql. I've already deleted all of the mailitems using:

    DECLARE @GETDATE datetime
    SET @GETDATE = GETDATE()
    EXECUTE msdb.dbo.sysmail_delete_mailitems_sp 
    @sent_before = @GETDATE;
    GO
    
    EXECUTE msdb.dbo.sysmail_delete_log_sp;
    GO
    Thursday, January 21, 2010 10:14 PM

All replies

  • why isn't sysmail_delete_mailitems_sp sufficient for you?
     

    -- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
    Proactive Performance Solutions, Inc.
    "Performance is our middle name."

    Please! Remember to Vote all helpful replies as Helpful
    Friday, January 22, 2010 3:40 PM
  • Our SQL Server went into a notification loop and there are several thousand entries in the ExternalMailQueue. I was hoping we could start fresh.

    Saturday, January 23, 2010 1:47 AM
  • You need some more detail here or something because I am still not getting what it is that you are looking for, and I still don't know what the answer to my question is: "why isn't sysmail_delete_mailitems_sp sufficient for you?"  Specifically, what do you need that it does not do for you?
    -- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
    Proactive Performance Solutions, Inc.
    "Performance is our middle name."

    Please! Remember to Vote all helpful replies as Helpful
    Saturday, January 23, 2010 6:39 AM
  • I think I'm good now. I reactivated the mail service and queue, let the system run it's course and ExternalMailQueue cleaned itself up. Thank you.

    Monday, January 25, 2010 2:27 PM
  • I think I'm good now. I reactivated the mail service and queue, let the system run it's course and ExternalMailQueue cleaned itself up. Thank you.

    hello...

    rusdmaster... I have the same problem you had. I ask that you do this instruction: I reactivate the queue and mail service, let the system run it's course and ExternalMailQueue Itself Cleaned up.

     

    I do the following: 

    alter queue ExternalMailQueue with status = off

    and then

    alter queue ExternalMailQueue with status = on

    and still the same messages in the queue.

    thank you very much

    Monday, November 29, 2010 5:38 PM