Last active
February 21, 2024 16:37
-
-
Save kristinaconley/5671506 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE ReportServer | |
SELECT | |
C.Name AS ReportName | |
,CASE | |
WHEN NEXT_RUN_DATE > 0 | |
THEN DATEADD(N,(NEXT_RUN_TIME%10000)/100 | |
,DATEADD(HH,NEXT_RUN_TIME/10000 | |
,CONVERT(DATETIME,CONVERT(VARCHAR(8),NEXT_RUN_DATE),112))) | |
ELSE CONVERT(DATETIME,CONVERT(VARCHAR(8),'19000101'),112) | |
END 'Next Run Date' | |
,[LastStatus] | |
,[DeliveryExtension] | |
FROM dbo.[Catalog] C (NOLOCK) | |
INNER JOIN dbo.[Subscriptions] S (NOLOCK) ON (C.ItemID = S.Report_OID) | |
INNER JOIN dbo.ReportSchedule R (NOLOCK) ON (S.SubscriptionID = R.SubscriptionID) | |
INNER JOIN msdb.dbo.sysjobs J (NOLOCK) ON (Convert(nvarchar(128),R.ScheduleID) = J.name) | |
INNER JOIN msdb.dbo.sysjobschedules JS (NOLOCK) ON (J.job_id = JS.job_id) | |
ORDER BY 2,1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment