|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Query posting wrong information
Why does this query post the wrong total_elapsed_time? Note you need to run
this query twice to see results. select execution_count abc_exe_count, total_elapsed_time, qt.sql_handle, last_execution_time, statement_end_offset, text from sys.dm_exec_query_stats qt cross apply sys.dm_exec_sql_text(qt.sql_handle) where text like '%abc_exe_count%' order by last_execution_time desc Greg,
Time is in microseconds on 2005, not milliseconds. When I run it, the answer looks about right. RLF Show quoteHide quote "Greg Larsen" <gregalar***@removeit.msn.com> wrote in message news:AB907027-DBE1-40E6-A172-C9E2794EDE7F@microsoft.com... > Why does this query post the wrong total_elapsed_time? Note you need to > run > this query twice to see results. > > select execution_count abc_exe_count, > total_elapsed_time, > qt.sql_handle, > last_execution_time, > statement_end_offset, text > from sys.dm_exec_query_stats qt > cross apply sys.dm_exec_sql_text(qt.sql_handle) > where text like '%abc_exe_count%' > order by last_execution_time desc Thanks for the answer. No matter how many times I read the BOL, I also read
milli, instead of micro. Show quoteHide quote "Russell Fields" wrote: > Greg, > > Time is in microseconds on 2005, not milliseconds. When I run it, the > answer looks about right. > > RLF > "Greg Larsen" <gregalar***@removeit.msn.com> wrote in message > news:AB907027-DBE1-40E6-A172-C9E2794EDE7F@microsoft.com... > > Why does this query post the wrong total_elapsed_time? Note you need to > > run > > this query twice to see results. > > > > select execution_count abc_exe_count, > > total_elapsed_time, > > qt.sql_handle, > > last_execution_time, > > statement_end_offset, text > > from sys.dm_exec_query_stats qt > > cross apply sys.dm_exec_sql_text(qt.sql_handle) > > where text like '%abc_exe_count%' > > order by last_execution_time desc > > >
Other interesting topics
Rolling Back from build 3159 to build 3152
can't access server from another PC SQL 2005 Performance One table returns ODBC timeout error Major SQL Server 2k5 x64 configuration problem Storing T-SQL code so it can't be read Change only USER tables to a new user ssrs Best practise on Database security Multiple database versions on same server. |
|||||||||||||||||||||||