Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
select * from msdb.dbo.sysmail_faileditems
and
SQL
select * from msdb.dbo.sysmail_sentitems

are very large data in this table.
How to purge data for certain dates???
Please guide me...
Posted
Updated 5-Dec-16 20:37pm

Very simple!

SQL
USE msdb
GO
DELETE FROM dbo.sysmail_sentitems WHERE [subject] LIKE '%abc%'-- Or any other filer criteria
 
Share this answer
 
SQL
USE msdb
GO
DELETE FROM dbo.sysmail_sentitems WHERE send_item between 'date1' and 'date2']
 
Share this answer
 
Comments
CHill60 6-Dec-16 10:55am    
The question is nearly 4 years old and has an accepted answer. You don't know what the column name is nor are 'date1' and 'date2' valid dates and there is another bug in the code you have presented. Solution 1 already stated "Or any other filer criteria" and the OP accepted that Solution. So there really was no need at all to re-open this question!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900