Wednesday, October 17, 2007

Identifying ReportingServices Jobs.

Yo.

Sorry I've been away for a while, but I have been a tad busy. Just thought I'd throw up a quick hello, and a helpful query.

SQL 2005 Reporting Services creates it's own jobs for reports that you schedule. Sadly instead of naming the job "Monthly Financial Analysis Report", it names the job with a GUID, like "33B9EA3B-00BB-4653-BD3D-8C6DE2C5AB98". This makes it really fun when trying to determine which report actually failed.

So, I wrote this, which returns a list of jobs, with their corresponding report names.


/* Report Server Job Names */
SELECT sj.name,
c.[path]
FROM [MSDB].[dbo].[sysjobs] sj
INNER JOIN [reportserver].[dbo].[reportschedule] rs
ON sj.name = CONVERT(NVARCHAR(100), rs.ScheduleID)
INNER JOIN [reportserver].[dbo].[catalog] c
ON rs.ReportID = c.ItemID


That should help.

Later.

-D.

No comments: