Showing posts with label Subscription. Show all posts
Showing posts with label Subscription. Show all posts

Wednesday, 11 July 2018

How to get a list of SSRS schedules for subscriptions

Hi Guys,

below script gives you the list of subscription set on each and every report of SSRS.


use ReportServer

select c.Name,
c.Path,
s.StartDate,
s.NextRunTime,
s.LastRunTime,
s.EndDate,
s.RecurrenceType,
s.LastRunStatus,
s.MinutesInterval,
s.DaysInterval,
s.WeeksInterval,
s.DaysOfWeek,
s.DaysOfMonth,
s.[Month],
s.MonthlyWeek
from dbo.catalog c with (nolock)
inner join dbo.ReportSchedule rs
on rs.ReportID = c.ItemID
inner join dbo.Schedule s with (nolock)
on rs.ScheduleID = s.ScheduleID
order by s.LastRunTime desc 

If you find any difficulty then reply on the comment box.
I will revert as soon as possible.

Thanks for the reading.

Tuesday, 17 March 2015

SSRS - Temporary Disable All Subscriptions

Temporary Disable Subscriptions


The InActiveFlags field in dbo.Subscriptions can be 1 or 0 (true or false).


--Code Snippet
--To Check Subscription Status.
USE ReportServer
SELECT dbo.Subscriptions.Description,
       dbo.[Catalog].Name,
       dbo.Users.UserName,
       InactiveFlags
FROM dbo.Subscriptions 
     INNER JOIN dbo.[Catalog] 
     ON dbo.Subscriptions.Report_OID = dbo.[Catalog].ItemID 
     INNER JOIN dbo.Users 
     ON dbo.Subscriptions.OwnerID = dbo.Users.UserID

------------------------------------------------------------------------------------------

--Temporary disables subscriptions while data warehouse is unavailable

UPDATE dbo.Subscriptions
SET InactiveFlags = 1
GO
--After this you can find, all the subscription where disabled until you again enable it.

Again enable subscriptions.

UPDATE dbo.Subscriptions
SET InactiveFlags = 0