Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the last time a particular report was run

I'm using SSRS 2016. I want to find out the last time a particular report was run. Is this something I can easily query on the ReportServer database? Thanks!

like image 531
cspell Avatar asked Sep 13 '25 15:09

cspell


1 Answers

You can get this from the executionlog tables/views in the ReportServer database. By default this will have (I think) 60 days of logs. You can change this value in the ReportServer properties. I have 400 days retention so I can report on report usage.

Anyway, you can use something like this...

USE ReportServer
GO

select TOP 1
    c.*
    , el.*
from ExecutionLog el
    join Catalog c on el.ReportID = c.ItemID
WHERE 
    c.[Path] = '/MyReportFolder/MyReportSubFolder' 
    and c.[Name] = 'MyReportName'
ORDER BY TimeStart DESC

The path =... is optional if all your report names are unique and the top 1 is there because you asked to only find the last time the report was run but you can obviously remove these limitations.

like image 85
Alan Schofield Avatar answered Sep 16 '25 10:09

Alan Schofield