我订阅了3年。我只是想删除2年未使用的,Old和Orphan订阅。
答案 0 :(得分:1)
转到==> Report Manager (SSRS Native Mode)。
在报表管理器中,单击全局工具栏上的“我的订阅”,然后导航到要修改或删除的订阅。
或者,在打开的报告的“订阅”选项卡上,找到要修改或删除的订阅。执行以下操作之一:
要删除订阅,请选中订阅旁边的复选框,然后点击删除。
注意:如果删除基础报告,则会自动删除订阅。
答案 1 :(得分:0)
Kavin的答案似乎涵盖了一般用例,但我还想补充说,订阅是数据库中的对象,如果需要可以删除。导航到报表服务器数据库,您可以查询所有订阅。
答案 2 :(得分:0)
下面的脚本显示了所有订阅/时间表/创建时间/上次执行时间(缺少归因的道歉)
您可以使用它来查找要转储订阅的位置,并使用@Kavins指示手动删除它们
--SSRS SUbscriptions
USE ReportServer
SELECT AgentJobName = sysjobs.NAME
,DataDriven = Case when subs.DataSettings is null then 0 else 1 end
,Recurrence = CASE WHEN recurrencetype = 1 THEN 'One off'
WHEN recurrencetype = 2 THEN 'Every '+ CAST(MinutesInterval AS VARCHAR(4))+' Minutes'
WHEN recurrencetype = 3 THEN 'Every '+ CAST(DaysInterval AS VARCHAR(4))+' Days'
WHEN recurrencetype = 4 THEN 'Every '+ CAST(WeeksInterval AS VARCHAR(4))+' Weeks'
WHEN recurrencetype = 5 THEN 'Monthly'
WHEN recurrencetype = 6 THEN 'Month Week' END
,Schedule = ISNULL(CASE
WHEN daysofmonth = 1 THEN '1st Day of'
WHEN daysofmonth = 2 THEN '2nd Day of'
WHEN daysofmonth = 4 THEN '3rd Day of'
WHEN daysofmonth = 8 THEN '4th Day of'
WHEN daysofmonth = 16 THEN '5th Day of'
WHEN daysofmonth = 32 THEN '6th Day of'
WHEN daysofmonth = 64 THEN '7th Day of'
WHEN daysofmonth = 128 THEN '8th Day of'
WHEN daysofmonth = 256 THEN '9th Day of'
WHEN daysofmonth = 512 THEN '10th Day of'
WHEN daysofmonth = 1024 THEN '11th Day of'
WHEN daysofmonth = 2048 THEN '12th Day of'
WHEN daysofmonth = 4096 THEN '13th Day of'
WHEN daysofmonth = 8192 THEN '14th Day of'
WHEN daysofmonth = 16384 THEN '15th Day of'
WHEN daysofmonth = 32768 THEN '16th Day of'
WHEN daysofmonth = 65536 THEN '17th Day of'
WHEN daysofmonth = 131072 THEN '18th Day of'
WHEN daysofmonth = 262144 THEN '19th Day of'
WHEN daysofmonth = 524288 THEN '20th Day of'
WHEN daysofmonth = 1048576 THEN '21st Day of'
WHEN daysofmonth = 2097152 THEN '22nd Day of'
WHEN daysofmonth = 4194304 THEN '23th Day of'
WHEN daysofmonth = 8388608 THEN '24th Day of'
WHEN daysofmonth = 16777216 THEN '25th Day of'
WHEN daysofmonth = 33554432 THEN '26th Day of'
WHEN daysofmonth = 67108864 THEN '27th Day of'
WHEN daysofmonth = 134217728 THEN '28th Day of'
WHEN daysofmonth = 268435456 THEN '29th Day of'
WHEN daysofmonth = 536870912 THEN '30th Day of'
WHEN daysofmonth = 1073741824 THEN '31st Day of'
WHEN daysofmonth = 8193 THEN '1st and 14th day Day of' END
,'')
+
ISNULL(
CASE WHEN Month = 4095 THEN 'Every Month'
WHEN MONTH = 585 THEN 'Jan,April,July,October'
WHEN Month = 1 THEN 'Jan'
WHEN Month = 2 THEN 'Feb'
WHEN Month = 4 THEN 'Mar'
WHEN Month = 8 THEN 'Apr'
WHEN Month = 16 THEN 'May'
WHEN Month = 32 THEN 'Jun'
WHEN Month = 64 THEN 'Jul'
WHEN Month = 128 THEN 'Aug'
WHEN Month = 256 THEN 'Sep'
WHEN Month = 512 THEN 'Oct'
WHEN Month = 1024 THEN 'Nov'
WHEN Month = 2048 THEN 'Dec' END
,'')
+
ISNULL(
CASE WHEN DaysOfWeek = 1 THEN 'Sunday'
WHEN DaysOfWeek = 2 THEN 'Monday'
WHEN DaysOfWeek = 4 THEN 'Tuesday'
WHEN DaysOfWeek = 8 THEN 'Wednesday'
WHEN DaysOfWeek = 16 THEN 'Thursday'
WHEN DaysOfWeek = 32 THEN 'Friday'
WHEN DaysOfWeek = 64 THEN 'Saturday'
WHEN DaysOfWeek = 62 THEN 'Monday - Friday'
WHEN DaysOfWeek = 120 THEN 'Wednesday - Saturday'
WHEN DaysOfWeek = 126 THEN 'Monday - Saturday'
WHEN DaysOfWeek = 127 THEN 'Daily'
END
,'')
+ ' '
+ CAST(DATEPART(hh,s.StartDate)AS VARCHAR(2))
+ CASE
WHEN LEN(CAST(DATEPART(n,s.StartDate)AS VARCHAR(2))) = 1
THEN ':0' + CAST(DATEPART(n,s.StartDate)AS VARCHAR(2))
ELSE ':' + CAST(DATEPART(n,s.StartDate)AS VARCHAR(2))
END
,IncludeReport
,ReportFormat
,c.Name
,c.Path
,subs.DESCRIPTION
,subs.laststatus
,subs.lastruntime
FROM msdb.dbo.sysjobs
INNER JOIN dbo.ReportSchedule rs ON sysjobs.name = CAST(rs.ScheduleID AS VARCHAR(255))
INNER JOIN dbo.Schedule s ON rs.ScheduleID = s.ScheduleID
INNER JOIN dbo.Catalog c ON rs.ReportID = c.ItemID
INNER JOIN Subscriptions subs ON subs.SubscriptionID = rs.subscriptionid
INNER JOIN (SELECT SubscriptionId,
IncludeReport=CASE WHEN SUBSTRING(ExtensionSettings,CHARINDEX('IncludeReport',CAST(ExtensionSettings as varchar(MAX)),0)+27,4) = 'True' THEN 'True' ELSE 'False' end,
ReportFormat= CASE WHEN SUBSTRING(ExtensionSettings,CHARINDEX('IncludeReport',CAST(ExtensionSettings as varchar(MAX)),0)+27,4) = 'True'
THEN SUBSTRING(ExtensionSettings, --field we are searching for
CHARINDEX('RenderFormat',CAST(ExtensionSettings as varchar(MAX)),0)+26, -- starting position
CHARINDEX('</V',ExtensionSettings,CHARINDEX('RenderFormat',CAST(ExtensionSettings as varchar(MAX)),0)+26) -- length
-(CHARINDEX('RenderFormat',CAST(ExtensionSettings as varchar(MAX)),0)+26)) END
FROM Subscriptions s
)Attachments ON Attachments.SubscriptionId = subs.SubscriptionId
ORDER BY c.Path,CAST(subs.DataSettings AS VARCHAR(3)),recurrencetype
答案 3 :(得分:0)
您可以使用来自 ReportServer 表的动态 sql 查询自动执行该过程:Catalog、ReportSchedule、Subscriptions。当我从 Web 界面删除订阅时,我在 Profiler 中发现了这些语句。
declare @DelSubscriptionID varchar(36);
select @DelSubscriptionID = cast(SubscriptionID as varchar(40))
from ReportSchedule
where ScheduleID = 'YourJobName';
exec AddSubscriptionToBeingDeleted @SubscriptionID = @DelSubscriptionID;
exec DeleteSubscription @SubscriptionID = @DelSubscriptionID;