Skip to content

Instantly share code, notes, and snippets.

@kristinaconley
Last active September 29, 2022 12:06
Show Gist options
  • Save kristinaconley/3628756 to your computer and use it in GitHub Desktop.
Save kristinaconley/3628756 to your computer and use it in GitHub Desktop.
Execute SSRS Subscription Manually
/*Execute SSRS Subscription Manually*/
USE ReportServer
SELECT
S.ScheduleID AS SQLAgent_Job_Name
,SUB.Description AS Sub_Desc
,SUB.DeliveryExtension AS Sub_Del_Extension
,C.Name AS ReportName
,C.Path AS ReportPath
FROM ReportSchedule RS (NOLOCK)
INNER JOIN Schedule S (NOLOCK) ON (RS.ScheduleID = S.ScheduleID)
INNER JOIN Subscriptions SUB (NOLOCK) ON (RS.SubscriptionID = SUB.SubscriptionID)
INNER JOIN [Catalog] C (NOLOCK) ON (RS.ReportID = C.ItemID AND SUB.Report_OID = C.ItemID)
WHERE
C.Name like '' --Enter Report Name to find Job_Name
/*Enter SQLAgent_Job_Name to execute the subscription based on Job ID*/
--USE msdb
--EXEC sp_start_job @job_name = '' --Enter SQLAgent_Job_Name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment