简体   繁体   中英

SSRS - Get the Subscription execution time

I have a query that gives me all the details about my Subscriptions in SSRS.

I join dbo.Subscriptions to dbo.ExecutionLogStorage on ReportID , however that gives me the last execution time for this particular report.

The same report is used with many parameters that can influence the execution time. Is there a way to connect LogStorage with particular instance of the Subscription?

I manage to identify what is a Subscription by looking at UserName and filtering by the SQL service account (that runs the Reporting Services) but getting the last for ReportID still doesn't means it is for that specific run, it only narrows it down to the last of the run of the service account for that report.

Simple part of the query I'm running:

SELECT 
    * 
FROM dbo.Subscriptions s
    LEFT JOIN dbo.ExecutionLogStorage els ON els.ReportID = s.Report_OID

but of course it gives me execution of each instance of the report in the subscription

You need to add a where cause to your query.

WHERE S.Parameters != '<ParameterValues />'

or

WHERE S.Parameters = '<ParameterValues>
                          <ParameterValue>
                              <Name>(ParmeterName)</Name>
                              <Value>(Parameter Value) </Value>
                          </ParameterValue>
                      </ParameterValues>'

Something like the above to find any parameters added or the second where to find specific values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM