Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / Reporting Services / July 2008

Tip: Looking for answers? Try searching our database.

Querying ExecutionLog Table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
A. Robinson - 15 Jul 2008 18:08 GMT
I'm writing a quick and dirty report to give to the powers that be showing
just how often - or not - certain reports are run. I'm also going to include
some other anecdotal information. One of the things I'd like to include are
average times (rendering, data retrieval, etc.). Here's what I've got so far
that works really well:

SELECT DISTINCT
c.Name,
c.Path,
c.CreationDate,
c.Description,
COUNT(e.ReportID) AS [Number of Times Executed],
MAX(e.TimeStart) AS [Last Time Executed],
AVG(e.[RowCount]) AS [AVG NUMBER OF ROWS],
AVG(e.timedataretrieval) AS [AVG DATA RETRIEVAL TIME],
AVG(e.timeprocessing) AS [AVG TIME PROCESSING],
AVG(e.timerendering) AS [AVG TIME RENDERING]
FROM ExecutionLog AS e INNER JOIN
Catalog AS c ON e.ReportID = c.ItemID
GROUP BY c.Name, c.Path, c.CreationDate, c.Description
ORDER BY c.Name

While this works great, there's one problem. When calculating the averages,
I only want to include those executions that had a status of rsSuccess. For
example, one report was run three times. One execution had an rsInternalError
with a row count of half a million. The other two times succeeded and had
significantly lower row counts. When calculating the averages, I'd like to
throw out the "bad" executions, so as not to skew the results.

Could someone suggest how I can tweak this query to accomplish this?

Thanks!!
Bruce L-C  [MVP] - 15 Jul 2008 19:08 GMT
Nice, I don't have a report like this so I will use yours as a start.
Looking at the ExecutionLog table it has a status. I added that to your
query to see what the values are. Using that for my basis I came up with
this code (obviously I'll make the dates parameters when I put this in a
report)
declare @STARTDATE datetime

declare @ENDDATE datetime

set @STARTDATE = dateadd(dd,-7,getdate())

set @ENDDATE = getdate()

SELECT DISTINCT c.Name, c.Path, c.CreationDate, c.Description,
COUNT(e.ReportID) AS [Number of Times Executed], MAX(e.TimeStart) AS [Last
Time Executed], AVG(e.[RowCount]) AS [AVG NUMBER OF ROWS],
AVG(e.timedataretrieval) AS [AVG DATA RETRIEVAL TIME], AVG(e.timeprocessing)
AS [AVG TIME PROCESSING], AVG(e.timerendering) AS [AVG TIME RENDERING]

FROM ExecutionLog AS e INNER JOIN Catalog AS c ON e.ReportID = c.ItemID

where e.status = 'rsSuccess' and timeStart >= @STARTDATE and timeEnd <
@ENDDATE

GROUP BY c.Name, c.Path, c.CreationDate, c.Description ORDER BY c.Name

Signature

Bruce Loehle-Conger
MVP SQL Server Reporting Services

> I'm writing a quick and dirty report to give to the powers that be showing
> just how often - or not - certain reports are run. I'm also going to
[quoted text clipped - 34 lines]
>
> Thanks!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.