SSRS Subscriptions table and ExecutionLog3 View

依然范特西╮ 提交于 2021-01-29 06:42:26

问题


We have many reports that have multiple subscriptions and I want to be able to monitor the executions by querying the Subscriptions table and ExecutionLog3 View.

There doesn't seem to be an obvious relationship between the table and view.

One particular report has one data driven subscription. The report is executed multiple times with a different parameter value each time. I particularly want to monitor the progress of this subscription. I want to be able to identify when it fails, when, and which parameter was used.

I came across a possible solution here but he accepted answer is wrong - see comments


回答1:


See if this works for you... I've been using this for quite some time.

    SELECT USR.UserName COLLATE Latin1_General_100_CI_AS_KS_WS AS SubscriptionOwner 
          ,SUB.ModifiedDate  as ModifiedDate
          ,SUB.[Description] COLLATE Latin1_General_100_CI_AS_KS_WS As Description
          ,SUB.EventType COLLATE Latin1_General_100_CI_AS_KS_WS as EventType
          ,SUB.DeliveryExtension COLLATE Latin1_General_100_CI_AS_KS_WS As DeliveryExtension
          ,SUB.LastStatus COLLATE Latin1_General_100_CI_AS_KS_WS as LastStatus
          ,SUB.LastRunTime  As LastRunTime
          ,SCH.NextRunTime  As NextRunTime
          ,SCH.Name    COLLATE Latin1_General_100_CI_AS_KS_WS    AS ScheduleName
          ,CAT.[Path]  COLLATE Latin1_General_100_CI_AS_KS_WS AS ReportPath
          ,CAT.[Description] COLLATE Latin1_General_100_CI_AS_KS_WS AS ReportDescription
          ,CAT.Name COLLATE Latin1_General_100_CI_AS_KS_WS AS ReportName
    FROM ReportServer.dbo.Subscriptions AS SUB 
         INNER JOIN ReportServer.dbo.Users AS USR 
             ON SUB.OwnerID = USR.UserID 
         INNER JOIN ReportServer.dbo.[Catalog] AS CAT 
             ON SUB.Report_OID = CAT.ItemID 
         INNER JOIN ReportServer.dbo.ReportSchedule AS RS 
             ON SUB.Report_OID = RS.ReportID 
                AND SUB.SubscriptionID = RS.SubscriptionID 
         INNER JOIN ReportServer.dbo.Schedule AS SCH 
             ON RS.ScheduleID = SCH.ScheduleID 
         INNER JOIN ReportServer.dbo.ExecutionLog3 EX 
            ON Cat.Path = EX.ItemPath AND EX.RequestType = 'Subscription'
    ORDER BY 1,10 


来源:https://stackoverflow.com/questions/55832103/ssrs-subscriptions-table-and-executionlog3-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!