sql server - Select returns no rows - queries in trace file -
i imported trace file using
select * trace_table ::fn_trace_gettable('c:\my_trace.trc', default)
while analyzing imported trace file noticed select statements take significant amount of time (duration) , cpu @ end not return rows (rowscount == null
).
select textdata, clientprocessid, eventclass , duration, starttime, endtime , reads, writes, cpu, rowcounts , eventsequence, textdata_md5_hash , applicationname, spid myimportedtrace textdata_md5_hash in (0x4a943f266010bdd2a47179dc3481bc7f) order spid, starttime, eventsequence
example
test in query window
if copy same query textdata
-field query window lot of rows (>200000)
questions
- what might reason query did not return rows?
- was query terminated ?
- how recognize failed query executions in trace file?
update / edit after answer accepted
this query
use mydatabase select ti.eventclass, te.eventname, count(*) countasterisk , sum(ti.rowcounts) rowcountssum , sum(ti.duration/1000) durationsum_ms , avg(ti.duration/1000) durationavg_ms traceimport ti left join traceevents te on ti.eventclass = te.eventtraceid group ti.eventclass, te.eventname order eventclass
returns result
sys.fn_trace_gettable
returns every possible column might have been captured.
there no guarantee actual trace looking @ did capture rowcounts
every relevant event class.
based on information have provided far there no reason think trace wasn't set this.
inside ssms click on tools / sql server profiler
opens sql-server-profiler application in window trace properties
click on tab event selection
, make sure column rowcounts
checked event class sql:batchcompleted
Comments
Post a Comment