Friday, July 01, 2011

Find the Report Name and its Exection time from ReportServer database on SSRS

-- Find Report Name from catalog table
Use ReportServer
go

select Type, Name, Path ,ItemId,ParentID
from [Catalog] where name like 'MyReport%'and Type = 2

 -- Find the ExecutionLog history for the Report of ItemId
select * from ExecutionLog where ReportID = '1C380565-ZXF9-9618-3727-28A04652E1B9'


 -- Please note reference between [Catalog] and [ExecutionLog] table is ItemId=ReportID

select e.ReportID, e.InstanceName,e.Format,e.TimeStart,e.TimeEnd
from [Catalog] c, ExecutionLog e
where c.ItemId= e.ReportID
and c.name like 'MyReport%' and c.Type = 2
order by e.TimeStart desc