Reports Not Used

  • Anyone have code snippet to find reports that have not been used? Any help will be appreciated.

  • I put together this bit of code, but I am not sure if it is returning the correct reports.

    Select c.Path

    ,c.Name as Report

    ,c.CreationDate as [Create Date]

    ,c.ModifiedDate as [Modified Date]

    ,e.LastUsed as [Last Used]

    ,e.UserName as [Last Used By]

    From Catalog c

    Left Join

    (

    SelectReportID

    ,max(TimeStart) as LastUsed

    ,UserName

    From ExecutionLog

    Group By ReportID, UserName

    )e on c.ItemID = e.ReportID

    Where c.Type = 2

    AND e.LastUsed IS NULL

    Order By c.Path ASC

  • Nice code. Looks accurate on my end.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Thanks for the verification. It is appreciated.

  • bpowers (6/21/2012)


    Thanks for the verification. It is appreciated.

    You're welcome

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Something is not right though. I ran one of the reports, that showed up on my list, and it did not fall off. Not sure why.

  • Got it. Forgot to include the TimeStart in my Group By (Sub Query).

    -- Reports that are not being used

    Select c.Path as Folder

    ,c.Name as Report

    ,c.CreationDate as [Create Date]

    ,c.ModifiedDate as [Modified Date]

    ,e.LastUsed as [Last Used]

    ,e.UserName as [Last Used By]

    From Catalog c

    Left Join

    (

    Select ReportID

    ,max(TimeStart) as LastUsed

    ,UserName

    From ExecutionLog

    Group By ReportID, UserName, TimeStart

    )e on c.ItemID = e.ReportID

    Where c.Type = 2

    AND e.LastUsed IS NULL

    Order By c.Path ASC

  • There is the set of SSRS diagnostic reports which Mike Davis wrote

    http://www.sqlservercentral.com/articles/Reporting+Services+%28SSRS%29/69257/

    Saves digging around in the RS db to get some useful information out of it.

  • Using standard configuration the Execution Log does not keep more than 60(?) days of information, so the posted queries are potentially mis-reporting. You need to keep an historical record of the execution log and report out of that.

  • it's interesting, but sometimes we wouldn't take much care about them.

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply