September 16, 2015 at 3:20 pm
Hi
I am trying to add a step to a SQL Agent job to call an SSRS schedule and email a report out. The issue I'm running into is that the ReportingServices database is telling me the JobIds for the schedules I want to execute--but those with daily schedules don't exist in SQL Agent!
I run the following:
SELECT
Sc.Name AS ScheduleName,
Rs.ScheduleID,
c.[path]
FROM Subscriptions S
INNER JOIN [Catalog] c on c.itemid = s.report_oid
INNER JOIN ReportSchedule RS ON S.SubscriptionID = RS.SubscriptionID
INNER JOIN Schedule Sc ON RS.ScheduleID = Sc.ScheduleID
ORDER BY sc.name
It gives me a list of ScheduleNames and IDs with the Path to the report. For anything that's weekly or monthly, the ScheduleId matches up to a SQL Agent Job. Anything that's daily, the ScheduleId does not match up to a SQL Agent Job. How can I find and execute and send these reports programatically?
September 16, 2015 at 7:14 pm
So my coworker figured it out... When you "pause" a job the SQL Agent Job is deleted... It gets recreated when you un-pause the job. Mystery solved!
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply