这是我的看法。我已经在 msdb 中运行它。我有一个数据库名称“mytest”
IF OBJECT_ID('[dbo].[vwconfirmEmailSent]') IS NOT NULL
DROP VIEW [dbo].[vwconfirmEmailSent]
GO
CREATE VIEW [dbo].[vwconfirmEmailSent]
AS
SELECT sa.recipients, sa.sent_status, sa.sent_date
FROM sysmail_allitems sa
LEFT join sysmail_sentitems ss ON ss.mailitem_id = sa.mailitem_id
LEFT JOIN sysmail_unsentitems su ON ss.mailitem_id = su.mailitem_id
当我使用 select * from [dbo].[vwconfirmEmailSent]