SSRS Report Usage Queries
SSRS Report Usage Queries
This last week I had the opportunity to do some work with SSRS, determining some stats on report
usage. I ended up digging up some queries that I wrote a couple years ago against the
ReportServer database, and thought they would be worthwhile to share, so here they are. These
have been tested against SQL Server 2008, and 2008R2 databases.
I hope these can save you some time if you need to track down details on SSRS report usage.
There is one place where the text DOMAIN_NAME is referenced. That is intended to be replaced
with your current domain.
Find out how many reports executions are in the log, and the oldest TimeStart
18 l.[RowCount]
19 FROM [ReportServer].[dbo].[ExecutionLog](NOLOCK) AS l
20 INNER JOIN [ReportServer].[dbo].[Catalog](NOLOCK) AS c ON l.ReportID =
21 WHERE c.Type = 2 -- Only show reports 1=folder, 2=Report, 3=Resource,
22 ORDER BY l.TimeStart DESC;
List the reports with the number of executions and time last run:
List the reports with the number of executions and time last run, including datasources.
21 GROUP BY l.ReportId,
22 c.Name,
23 c.[Path];
List the reports with the number of executions and time last run, including datasources and who
has been using the report.
https://stevestedman.com/2016/01/ssrs-report-usage-queries/ 3/6
3/28/24, 11:38 AM SSRS Report Usage Queries - Steve Stedman
Reports that haven’t been run since the last time the log was cleared.
https://stevestedman.com/2016/01/ssrs-report-usage-queries/ 4/6
3/28/24, 11:38 AM SSRS Report Usage Queries - Steve Stedman
3 c.[Path],
4 AVG(l.TimeDataRetrieval + l.TimeProcessing + l.TimeRendering) / 1000.0
5 SUM(l.TimeDataRetrieval + l.TimeProcessing + l.TimeRendering) / 1000.0
6 SUM(l.TimeDataRetrieval + l.TimeProcessing + l.TimeRendering) / 1000.0
7 COUNT(*) TimesRun
8 FROM [ReportServer].[dbo].[ExecutionLog](NOLOCK) AS l
9 INNER JOIN [ReportServer].[dbo].[Catalog](NOLOCK) AS c ON l.ReportID =
10 WHERE c.Type = 2 -- Only show reports 1=folder, 2=Report, 3=Resource,
11 GROUP BY c.Name,
12 c.[Path],
13 l.InstanceName,
14 l.ReportID
15 HAVING AVG(l.TimeDataRetrieval + l.TimeProcessing + l.TimeRendering) /
16 ORDER BY AVG(l.TimeDataRetrieval + l.TimeProcessing + l.TimeRendering)
17
18 -- List the reports with the last time run
19 -- Written by Steve Stedman http://SteveStedman.com
20 SELECT c.Name,
21 c.[Path],
22 MAX(l.TimeStart) AS [LastRun]
23 FROM [ReportServer].[dbo].[ExecutionLog] AS l WITH (NOLOCK)
24 INNER JOIN [ReportServer].[dbo].[Catalog] AS c WITH (NOLOCK) ON l.Repo
25 WHERE c.Type = 2 -- Only show reports 1=folder, 2=Report, 3=Resource,
26 GROUP BY l.ReportId,
27 c.Name,
28 c.[Path]
29 ORDER BY [LastRun] DESC;
https://stevestedman.com/2016/01/ssrs-report-usage-queries/ 6/6