I have several timed subscriptions that are running and I would like to cancel them. I looked at the SQL Server agent and the jobs are not in there. Does anyone know of a command in SQL Server that I can execute to kill/cancel the jobs?
I'm using this code to look at the subscriptions I want to cancel:
SELECT USR.UserName AS SubscriptionOwner
,sub.SubscriptionID
,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.EventType = 'TimedSubscription'
and Sch.name ='Participation Reports'
ORDER BY CAT.[Path];
use the schedule name from your query above to run the following command to stop it
:
USE [msdb]
EXEC sp_stop_job @job_name = 'name of your job goes here'