September 10, 2014 at 3:43 pm
Hi,
I need to find which SQL Agent job is created when we subscribe SSRS report.
SELECT
b.name AS JobName
, e.name
, e.path
, d.description
, a.SubscriptionID
, laststatus
, eventtype
, LastRunTime
, date_created
, date_modified
FROM ReportServer.dbo.ReportSchedule a JOIN msdb.dbo.sysjobs b
ON a.ScheduleID = b.name
JOIN ReportServer.dbo.ReportSchedule c
ON b.name = c.ScheduleID
JOIN ReportServer.dbo.Subscriptions d
ON c.SubscriptionID = d.SubscriptionID
JOIN ReportServer.dbo.Catalog e
ON d.report_oid = e.itemid
WHERE e.name = 'Sales_Report'
but I am getting error message conversion failed from character string to unique identifier.
How to convert when we are using in joins?
September 11, 2014 at 5:58 am
This was removed by the editor as SPAM
September 11, 2014 at 7:08 am
SELECTj.name AS JobName
, c.name
, c.path
, c.description
, rs.SubscriptionID
, laststatus
, eventtype
, LastRunTime
, date_created
, date_modified
FROMReportServer.dbo.[Catalog] c
JOIN ReportServer.dbo.Subscriptions s
ON s.report_oid = c.itemid
JOIN ReportServer.dbo.ReportSchedule rs
ON rs.SubscriptionID = s.SubscriptionID
JOIN msdb.dbo.sysjobs j
ON j.[name] = CAST(rs.ScheduleID as varchar(100))
WHEREc.name = 'Sales_Report'
Far away is close at hand in the images of elsewhere.
Anon.
September 11, 2014 at 8:27 am
Here I am getting both date_created and date_modified are same values.
i.e. no one moified the job but how I am getting the report twice
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply