Link to home
Start Free TrialLog in
Avatar of Bharat Guru
Bharat Guru

asked on

SQL to find list of subscriptions for CSV reports.

Looking for SQL to find list of subscriptions for SSRS reports exporting as csv formate.
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bharat Guru
Bharat Guru

ASKER

How to get filename? I'm looking for SSRS report names for CSV file only.
Hi Bharat,
Please use below. Its the modified version from microsoft.-

USE [ReportServer];
GO 
 
SELECT 
	   CAT.Name ReportName
      ,USR.UserName AS SubscriptionOwner 
      ,SUB.ModifiedDate 
      ,SUB.[Description] 
      ,SUB.EventType 
      ,SUB.DeliveryExtension 
      ,SUB.LastStatus 
      ,SUB.LastRunTime 
      ,SCH.NextRunTime 
      ,SCH.Name AS ScheduleName       
      ,CAT.[Path] AS ReportPath 
      ,CAT.[Description] AS ReportDescription 
FROM dbo.Subscriptions AS SUB 
     INNER JOIN dbo.Users AS USR 
         ON SUB.OwnerID = USR.UserID 
     INNER JOIN dbo.[Catalog] AS CAT 
         ON SUB.Report_OID = CAT.ItemID 
     INNER JOIN dbo.ReportSchedule AS RS 
         ON SUB.Report_OID = RS.ReportID 
            AND SUB.SubscriptionID = RS.SubscriptionID 
     INNER JOIN dbo.Schedule AS SCH 
         ON RS.ScheduleID = SCH.ScheduleID 
WHERE SUB.DeliveryExtension LIKE '%CSV%' OR SUB.ExtensionSettings LIKE '%CSV%'
ORDER BY USR.UserName 
        ,CAT.[Path];

Open in new window


https://gallery.technet.microsoft.com/scriptcenter/List-all-SSRS-subscriptions-968ae4d5
Hope it helps!
Hi,
Have you tried my last option?
thanks