Re: Need help from Gurus: Profiler columns
- From: "Russell Fields" <russellfields@xxxxxxxxxx>
- Date: Tue, 22 Apr 2008 18:11:11 -0400
NT007,
DATEDIFF counts boundaries, not actual interval. So, if the starttime and
endtime is inside the same second, DATEDIFF returns 0, but if the starttime
and endtime are in different seconds, then you will get a non-zero answer.
Duration is in microseconds, by the way, but you can look for equivalancies
by the following query.
SELECT TOP 100 Duration, ROUND((DATEDIFF(millisecond,StartTime,EndTime) /
1000.0),0) AS Seconds
FROM dbo.MyTraceTable
WHERE TextData IS NOT NULL
AND EventClass=10
ORDER BY Duration DESC
You will still notice that StartTime and EndTime and Duration are not quite
measuring the same thing, but they will be much closer.
RLF
"NT007" <JSNT007@xxxxxxxxx> wrote in message
news:OWhk%23wLpIHA.3408@xxxxxxxxxxxxxxxxxxxxxxx
Please help me understand "duration", "starttime", and "endtime" columns
in trace tables. The most confusing part is that the duration does not
match with starttime and endtime. I started a proviler and had results
stored in a table. Then I ran this query:
This is the query:
SELECT TOP 100 Duration,DATEDIFF(SS,StartTime,EndTime) AS Seconds
FROM dbo.MyTraceTable
WHERE TextData IS NOT NULL
AND EventClass=10
ORDER BY Duration DESC
Herer is the result:
Duration Seconds
-------------------- -----------
1602762 2
1405132 1
1326891 1
1025625 1
991591 1
871435 1
827483 0
822292 1
811629 0
790301 1
674423 1
644614 0
569360 0
561454 1
561160 0
488116 0
488042 1
487850 0
476883 0
474491 1
474374 0
454646 0
454173 1
453678 0
.
- Follow-Ups:
- Re: Need help from Gurus: Profiler columns
- From: Russell Fields
- Re: Need help from Gurus: Profiler columns
- References:
- Need help from Gurus: Profiler columns
- From: NT007
- Need help from Gurus: Profiler columns
- Prev by Date: Need help from Gurus: Profiler columns
- Next by Date: Re: Need help from Gurus: Profiler columns
- Previous by thread: Need help from Gurus: Profiler columns
- Next by thread: Re: Need help from Gurus: Profiler columns
- Index(es):
Relevant Pages
|