How can I set up email notification when an error is encountered in reporting services

前端 未结 2 1480
感动是毒
感动是毒 2021-01-06 15:31

I have some reports that are configured for email delivery in reporting services. Last night we experienced some network outtages and reporting services was unable to connec

2条回答
  •  礼貌的吻别
    2021-01-06 16:24

    (You want an email when email can't be delivered?)

    Directly within SSRS this can't be done. But you could have a SQL agent monitor the status of the subscriptions. The SQL agent can be configured to send email pretty easily. The status of the last run is stored in the subscriptions table.

    From: http://blogs.msdn.com/b/deanka/archive/2009/01/13/diagnosing-and-troubleshooting-subscriptions.aspx

    select
    'SubnDesc' = s.Description,
    'SubnOwner' = us.UserName,
    'LastStatus' = s.LastStatus,
    'LastRun' = s.LastRunTime,
    'ReportPath' = c.Path,
    'ReportModifiedBy' = uc.UserName,
    'ScheduleId' = rs.ScheduleId,
    'SubscriptionId' = s.SubscriptionID
    from ReportServer.dbo.Subscriptions s
    join ReportServer.dbo.Catalog c on c.ItemID = s.Report_OID
    join ReportServer.dbo.ReportSchedule rs on rs.SubscriptionID = s.SubscriptionID
    join ReportServer.dbo.Users uc on uc.UserID = c.ModifiedByID
    join ReportServer.dbo.Users us on us.UserID = s.OwnerId
    join msdb.dbo.sysjobs j on j.name = CONVERT(nvarchar(128),rs.ScheduleId)
    

    But none of these methods queue the email: they try, and if there is a network problem they give lose the email. You could possibly install a SMTP relay on your Reporting Services machine to get around this.

提交回复
热议问题