审核 SSRS 报告以获取 SQL 服务器上的最后运行时间和状态
Auditing SSRS reports to get the last runtime and status on SQL Server
我在 SQL 服务器中有 3 table 存储每次执行 SSRS 报告的数据
- 订阅
- 目录
- 用户:公司员工的默认 table
我想获取以下信息:
- 创建者
- 上次修改者
- SSRS 报告的路径
- SSRS 报告的名称
- 上次运行时间
- 上次状态
您的要求与我很久以前一直在做的事情类似。
SELECT
U1.UserName AS CreatedBy
,U2.UserName AS LastModifiedBy
,C.[path] AS [Path]
,C.[Name] AS [Name]
,S.LastRunTime
,S.LastStatus
,S.ExtensionSettings
FROM [Subscriptions] AS S
INNER JOIN [Catalog] AS C
ON S.Report_OID = C.ItemID
INNER JOIN [Users] AS U1
ON S.OwnerID = U1.UserID
INNER JOIN [Users] AS U2
ON S.ModifiedByID = U2.UserID
ORDER BY U1.UserName
, U2.UserName
, C.[path];
我在 SQL 服务器中有 3 table 存储每次执行 SSRS 报告的数据
- 订阅
- 目录
- 用户:公司员工的默认 table
我想获取以下信息:
- 创建者
- 上次修改者
- SSRS 报告的路径
- SSRS 报告的名称
- 上次运行时间
- 上次状态
您的要求与我很久以前一直在做的事情类似。
SELECT
U1.UserName AS CreatedBy
,U2.UserName AS LastModifiedBy
,C.[path] AS [Path]
,C.[Name] AS [Name]
,S.LastRunTime
,S.LastStatus
,S.ExtensionSettings
FROM [Subscriptions] AS S
INNER JOIN [Catalog] AS C
ON S.Report_OID = C.ItemID
INNER JOIN [Users] AS U1
ON S.OwnerID = U1.UserID
INNER JOIN [Users] AS U2
ON S.ModifiedByID = U2.UserID
ORDER BY U1.UserName
, U2.UserName
, C.[path];