Link to home
Start Free TrialLog in
Avatar of motioneye
motioneyeFlag for Singapore

asked on

sql query to reportserver table error

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.



SELECT
          c.Name AS ReportName
          , rs.ScheduleID AS JOB_NAME
          , s.[Description]
          , s.LastStatus
          , s.LastRunTime
          --,JBS.Name
              --INTO drop table JOBS_Error
    FROM
          ReportServer..[Catalog] c
          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
ASKER CERTIFIED SOLUTION
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of motioneye

ASKER

Thanks both of you .