Sql-Server 邮件相关的查询和删除
程序员文章站
2022-03-31 13:29:31
参考:https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sysmail-delete-mailitems-sp-transact-sqlhttps://docs.microsoft.c ......
-- 查询邮件发送记录和报告 SELECT TOP(50) * FROM msdb.dbo.sysmail_allitems ORDER BY mailitem_id DESC SELECT TOP(50) * FROM msdb.dbo.sysmail_event_log ORDER BY log_id DESC -- 删除指定时间之前的邮件发送记录和报告 EXECUTE msdb.dbo.sysmail_delete_mailitems_sp @sent_before = '2018-03-01 00:00'; GO EXECUTE msdb.dbo.sysmail_delete_log_sp @logged_before = '2018-03-01 00:00'; GO
参考:
https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sysmail-delete-mailitems-sp-transact-sql
https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sysmail-delete-log-sp-transact-sql
上一篇: 练练字幽默指甲涂上了橙色
下一篇: 今年听过的最悲伤的故事