Skip to content
Advertisement

Auditing SSRS reports to get the last runtime and status on SQL Server

I have 3 tables in SQL Server storing data for every execution of SSRS report

  • Subscription
  • Catalog
  • Users : default table for employees in the company

I want to get the following information :

  • CreatedBy
  • LastModifiedBy
  • Path of the SSRS report
  • Name of the SSRS report
  • Last runtime
  • Last status

Advertisement

Answer

Your request is similar to something I have been working on a long time ago.

SELECT
        U1.UserName AS CreatedBy
       ,U2.UserName AS LastModifiedBy
       ,C.[path] AS [Path]
       ,C.[Name] AS [Name]
       ,S.LastRunTime
       ,S.LastStatus
       ,S.ExtensionSettings
    FROM [Subscriptions] AS S
    INNER JOIN [Catalog] AS C
        ON S.Report_OID = C.ItemID
    INNER JOIN [Users] AS U1 
        ON S.OwnerID = U1.UserID
    INNER JOIN [Users] AS U2 
        ON S.ModifiedByID = U2.UserID
 
    ORDER BY U1.UserName
    , U2.UserName
    , C.[path];
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement