分析 Reporting Services 報表訂閱的執行狀況

不錯的 blog:Report launcher to run SSRS report subscriptions on demand

不過另一篇:How to easily identify a scheduled SQL Server Reporting Services report Join 條件可能要改一下

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 convert(varchar(100),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

SELECT
    ‘EXEC ReportServer.dbo.AddEvent @EventType="TimedSubscription", @EventData="‘
+ CAST(a.SubscriptionID AS VARCHAR(40)) + “" AS ReportCommand
            , b.name AS JobName
            , a.SubscriptionID
            , e.name
            , e.path
            , d.description
            , laststatus
            , eventtype
            , LastRunTime
            , date_created
            , date_modified
    FROM ReportServer.dbo.ReportSchedule a JOIN msdb.dbo.sysjobs b
            ON convert(varchar(100),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

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

%d 位部落客按了讚: