SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Server Long Query Script


SQL Server Long Query Script

Author
Message
yusufkahveci
yusufkahveci
SSC Veteran
SSC Veteran (230 reputation)SSC Veteran (230 reputation)SSC Veteran (230 reputation)SSC Veteran (230 reputation)SSC Veteran (230 reputation)SSC Veteran (230 reputation)SSC Veteran (230 reputation)SSC Veteran (230 reputation)

Group: General Forum Members
Points: 230 Visits: 649
Comments posted to this topic are about the item SQL Server Long Query Script

SQL Server Consultant
yusufkahveci@sqlturkiye.com
www.sqlturkiye.com
joseph.williams 87509
joseph.williams 87509
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 13
Seems really useful thanks, but what unit of time are the max elapsed time and avg elapsed time in? (seconds, milliseconds etc)

Thank you
Joe
HanShi
HanShi
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28316 Visits: 4182
joseph.williams 87509 - Wednesday, May 30, 2018 4:11 AM
Seems really useful thanks, but what unit of time are the max elapsed time and avg elapsed time in? (seconds, milliseconds etc)

Thank you
Joe

As from BOL / MSDN / docs:
"max_elapsed_time........bigint........Maximum elapsed time, reported in microseconds (but only accurate to milliseconds), for any completed execution of this plan."

If you repace the max-duration and avg fields with the SQL code below, the result will show the values converted to the TIME datatype (which is more human friendly readable)

-- ,eqs.max_elapsed_time AS sqltr_maxelapsedTime
,cast(dateadd(MILLISECOND, eqs.max_elapsed_time/1000, '0:00:00') as time(3)) AS sqltr_maxelapsedTime
-- ,ISNULL(eqs.total_elapsed_time / NULLIF(eqs.execution_count, 0), 0) AS sqltr_avgElapsedTime
,cast(dateadd(MILLISECOND, ISNULL(eqs.total_elapsed_time / NULLIF(eqs.execution_count, 0), 0)/1000, '0:00:00') as time(3)) AS sqltr_avgElapsedTime


** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search