Powered By Blogger

Wednesday, March 28, 2012

Reporting Services Active Subscriptions Query

If you are in an environment where a number of people have the capability to create subscriptions then you may want to keep tabs on them. The ones you have created are available under "My subscriptions" and depending on your own role you can also tab through all the Report folders looking for active subscriptions. I quickly got bored/tired of this so we created an SSRS report that shows all the active subscriptions. The query is as follows and gives you the basis of a useful straighforward report.



SELECT   u.UserName,
         c.Name AS TheReport,
         s.SubscriptionID,
         s.OwnerID,
         s.Report_OID,
         s.Locale,
         s.InactiveFlags,
         s.ExtensionSettings,
         s.ModifiedByID,
         s.ModifiedDate,
         s.Description,
         s.LastStatus,
         s.EventType,
         s.MatchData,
         s.LastRunTime,
         s.Parameters,
         s.DataSettings,
         s.DeliveryExtension,
         s.Version
FROM     Catalog AS c
         INNER JOIN
         Subscriptions AS s
         ON s.Report_OID = c.ItemID
         INNER JOIN
         Users AS u
         ON u.UserID = s.OwnerID
WHERE    (s.LastRunTime BETWEEN @pStartDate AND @pEndDate)
ORDER BY TheReport;

No comments:

Post a Comment

Would love to get feedback on any of my posts.