sql query to reportserver table error
Posted on 2016-11-25
I have a query below which run fine except when I include the join to the sysjobs table, I just can't figure out why the query get error, anyone has ideas where and how to start troubleshooting ? Here is the error message return.
Msg 8169, Level 16, State 2, Line 17
Conversion failed when converting from a character string to uniqueidentifier.
c.Name AS ReportName
, rs.ScheduleID AS JOB_NAME
--INTO drop table JOBS_Error
JOIN ReportServer..Subscriptions s ON c.ItemID = s.Report_OID
JOIN ReportServer..ReportSchedule rs ON c.ItemID = rs.ReportID
JOIN msdb..sysjobs jbs ON JBS.Name = rs.ScheduleID
AND rs.SubscriptionID = s.SubscriptionID