USE [ReportServer]
/*
useful code for getting the run history and parameters used of a report
*/
DECLARE @ReportName AS VARCHAR(MAX)
SET @ReportName = '%Report1%'--report name hers surrounded by wildcards
SELECT * FROM
(
SELECT
InstanceName,
COALESCE(C.Path, 'Unknown') AS ItemPath,
UserName,
ExecutionId,
CASE(RequestType)
WHEN 0 THEN 'Interactive'
WHEN 1 THEN 'Subscription'
WHEN 2 THEN 'Refresh Cache'
ELSE 'Unknown'
END AS RequestType, -- SubscriptionId,
Format, Parameters,
CASE(ReportAction) WHEN 1 THEN 'Render'
WHEN 2 THEN 'BookmarkNavigation'
WHEN 3 THEN 'DocumentMapNavigation'
WHEN 4 THEN 'DrillThrough'
WHEN 5 THEN 'FindString'
WHEN 6 THEN 'GetDocumentMap'
WHEN 7 THEN 'Toggle'
WHEN 8 THEN 'Sort'
WHEN 9 THEN 'Execute'
ELSE 'Unknown'
END AS ItemAction,
TimeStart,
TimeEnd,
TimeDataRetrieval,
TimeProcessing,
TimeRendering,
CASE(Source)
WHEN 1 THEN 'Live'
WHEN 2 THEN 'Cache'
WHEN 3 THEN 'Snapshot' WHEN 4 THEN 'History'
WHEN 5 THEN 'AdHoc'
WHEN 6 THEN 'Session'
WHEN 7 THEN 'Rdce'
ELSE 'Unknown'
END AS Source,
Status,
ByteCount,
[RowCount],
AdditionalInfo
FROM ExecutionLogStorage EL WITH(NOLOCK)
LEFT OUTER JOIN Catalog C WITH(NOLOCK) ON (EL.ReportID = C.ItemID)
)AS a
WHERE ItemPath like @ReportName
Gerard's codebase
This is a personal repository of code snippets and information.
Over the years I have generated lots of little sub programs and stored away acres of useful code snippets. The problem is always to locate them.
Even more time wasting is forgetting how to do simple things when you havnt developed in an environment for a few years (or even a few months)
My new years resolution is to start putting them up in a common place as I produce them. (thanks google)
They are handy for me and, with a bit of a clean up and documentation, they might be handy for others if they wander in here.
Gerard 2008
Over the years I have generated lots of little sub programs and stored away acres of useful code snippets. The problem is always to locate them.
Even more time wasting is forgetting how to do simple things when you havnt developed in an environment for a few years (or even a few months)
My new years resolution is to start putting them up in a common place as I produce them. (thanks google)
They are handy for me and, with a bit of a clean up and documentation, they might be handy for others if they wander in here.
Gerard 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment