SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Subscription failed for more than 10 days, then disable and Delete the Subscription


Subscription failed for more than 10 days, then disable and Delete the Subscription

Author
Message
GA_SQL
GA_SQL
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2602 Visits: 585
Requirement: Subscription failed for more than 10 days, then disable and Delete the Subscription

I found script something like this..

select c.Name as ReportName,
s.EventType,
s.Description as SubscriptionDescription,
s.LastStatus as LastSubscriptionStatus,
s.LastRunTime SubscriptionLastRunTime,
case
when recurrencetype = 1 then 'One Time'
when recurrencetype = 2 then 'Hourly'
when recurrencetype = 4 then 'Daily'
when recurrencetype = 5 then 'Monthly'
when recurrencetype = 6 then 'Month Week'
else 'Other'
end as RecurranceType,
s.DeliveryExtension,
u.UserName as SubscriptionSetUpBy,
s.ModifiedDate as SubscriptionLastModifiedDate
from [ReportServer].[dbo].[Subscriptions] s
join [ReportServer].[dbo].[Catalog] c
on c.ItemID = s.Report_OID
join [ReportServer].[dbo].[Users] u
on u.UserID = s.OwnerID
join [ReportServer].[dbo].[reportschedule] rs
on c.itemid = rs.reportid
and s.subscriptionid = rs.subscriptionid
join [ReportServer].[dbo].[schedule] sch
on rs.scheduleid = sch.scheduleid
where s.EventType <> 'RefreshCache'
and s.LastRunTime < dateadd(D, -10, getdate())
and s.LastStatus='%Failure%'
order by c.name

To Disable and Delete the Subscription what are the steps to be added..
Thanks in advance
Sue_H
Sue_H
SSC Guru
SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)SSC Guru (72K reputation)

Group: General Forum Members
Points: 72542 Visits: 14916


Once you identify the subscription, go to Report Manager, go to subscriptions, find the subscription and delete it.
Create and Manage Subscriptions for Native Mode Report Servers

If you wanted to write code to use the web services to do this, look at the DeleteSubscription method
If you wanted to use Powershell to delete them instead, import the ReportingServicesTools module and use the Remove-RSSubscription cmdlet.

Sue



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search