紀錄 Reporting Services 的訂閱執行歷程

因為 RS 的訂閱 log 是寫在 file 內,預設 system table Subscriptions 只有 laststatus,因應朋友 Jay 的需求,他提醒可以用 trigger 來記錄:

use ReportServer
go
SELECT [SubscriptionID]
      ,[LastStatus]
      ,[LastRunTime] into tbRecord
  FROM [ReportServer].[dbo].[Subscriptions]
  where 1=0
  go

 

create trigger trgSub on Subscriptions
  for update,insert
  as
  insert tbRecord select [SubscriptionID]
      ,[LastStatus]
      ,[LastRunTime] from inserted
go

select * from Subscriptions
select * from tbRecord

 

 

此外,要小心規劃清掉 log 的排程

發表迴響

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

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 位部落客按了讚: