Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
michaeljc70
Starting Member
7 Posts |
Posted - 2010-07-26 : 12:38:40
|
I am trying to get the total logical reads for a sproc. If I turn the stats on, there are way way too many individual SQL statements to add up he logical reads.I started SQL Profiler and can see the sproc getting executed (I selected to monitor via SPID). I must be blind/clueless though as to where to see the total IO after the proc finishes and I stop the trace. What am I missing? |
|
Kristen
Test
22859 Posts |
Posted - 2010-07-26 : 12:51:57
|
I doSET STATISTICS IO ON; SET STATISTICS TIME ONGOEXEC MySprocGOSET STATISTICS IO OFF; SET STATISTICS TIME OFFGO but presumably that's what you are referring to as having too many individual SQL statements to then add up? |
 |
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2010-07-26 : 14:40:08
|
you can also use:set showplan_all onset showplan_xml on{your query}set showplan_all offset showplan_xml off and you can always use actual execution plan as well as estimated execution plan. |
 |
|
michaeljc70
Starting Member
7 Posts |
Posted - 2010-07-27 : 10:43:03
|
Right. The sproc calls others and there are literally 100's of them to add up. I manipulated them in Excel, but it seems there must be an easier way.quote: Originally posted by Kristen I doSET STATISTICS IO ON; SET STATISTICS TIME ONGOEXEC MySprocGOSET STATISTICS IO OFF; SET STATISTICS TIME OFFGO but presumably that's what you are referring to as having too many individual SQL statements to then add up?
|
 |
|
Kristen
Test
22859 Posts |
Posted - 2010-07-27 : 11:01:00
|
Sorry, I don't have a smarter answer then but I'll be interested to hear if you find one please |
 |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-07-28 : 10:51:28
|
Use profiler to log it to a table. Then sum the reads and writes |
 |
|
michaeljc70
Starting Member
7 Posts |
Posted - 2010-07-29 : 12:33:05
|
quote: Originally posted by russell Use profiler to log it to a table. Then sum the reads and writes
Thanks- that's exactly what I wanted. |
 |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-07-29 : 13:49:15
|
Glad to help |
 |
|
|
|
|