Sql-Server 邮件相关的查询和删除
程序员文章站
2022-07-29 19:21:46
参考: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
上一篇: 学校里,老师逗的你爆笑
下一篇: 校园的爆囧坑爹、损人事