Tuesday, January 27, 2009

Find out who is viewing the reports on SQL server reporting services 2005

This SQL script should give you the list of users using the reports on the reporting server 2005 platform.It can be used for auditing platform as well.

SELECT s.ReportName,s.UserName,COUNT(*)
FROM
(
SELECT cat.Name ReportName,
ex.UserName,
TimeStart
FROM ReportServer.dbo.ExecutionLog AS ex
INNER JOIN ReportServer.dbo.Catalog AS cat ON ex.ReportID = cat.ItemID
WHERE ex.TimeStart >= GETDATE() - 1
--ORDER BY ReportName
) s
GROUP BY s.ReportName,s.username

No comments: