A very basic query to look at the ReportServer database to pull what reports there are, who has ran it, and how many times.
Code Snippet
- SELECT
- c.NAME,
- el.UserName,
- el.LATEST_RUN_DATE,
- el.NUM_TIMES_RAN,
- c.[path]
- FROM
- DBO.[CATALOG] AS c
- LEFT JOIN
- (
- SELECT
- EL.REPORTID
- ,EL.UserName
- ,COUNT(EL.TIMESTART) NUM_TIMES_RAN
- ,MAX(EL.TIMESTART) AS LATEST_RUN_DATE
- FROM
- dbo.EXECUTIONLOG AS el
- GROUP BY
- el.REPORTID, EL.UserName
- )el on el.ReportID = c.ItemID
- WHERE
- C.[TYPE] = 2
- ORDER BY c.NAME, el.UserName
No comments:
Post a Comment