Getting Started with Adobe After Effects - Part 6: Motion Blur
A collection of quick technology learning tips from what people around you learn every day

SQL Server- To delete old email messages with T-SQL.

Dec 16 2011 7:23PM by Fazal Vahora   

I just learned today new thing,"How to delete old e-mail messages from database mail internal tables with using sysmaildeletemailitems_sp" check out following query.

USE MSDB
GO
Exec sysmail_delete_mailitems_sp @sent_before ='2011/12/14',@sent_status ='sent'
GO

Argumnets: @sentbefore-Delete emails upto the date and time provided,if provided NULL,it indicates all dates. @sentstatus-Delete emails of type specified like sent,unsent,retrying and failed,NULL indicates all status.

Read More..   [0 clicks]

Published under: SQL Server Tips ·  ·  ·  · 


Fazal Vahora
21 · 9% · 2806
11
 
1
 
11
 
0
Incorrect
 
0
Interesting
 
0
Forgotten



Submit

3  Comments  

  • Where is this stored procedure kept? I see all the sysmail tables and can run the above stored procedure. But I can't find the stored procedure itself in the msdb database.

    commented on Dec 17 2011 1:25AM
    dishdy
    17 · 10% · 3262
  • MSDN link for more information: sysmaildeletemailitemssp

    commented on Dec 18 2011 10:41PM
    Hardik Doshi
    20 · 9% · 2839
  • Well, for reasons I cannot explain, I now see the stored procedures in msdb.

    commented on Dec 19 2011 1:12AM
    dishdy
    17 · 10% · 3262

Your Comment


Sign Up or Login to post a comment.

"SQL Server- To delete old email messages with T-SQL." rated 5 out of 5 by 11 readers
SQL Server- To delete old email messages with T-SQL. , 5.0 out of 5 based on 11 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]