Sql Server : Enable execution STATISTICS for IO and Time for queries
- Posted by Sqltimes
- On August 2, 2014
- 0 Comments
Quick one today:
Sometimes, for some scripts, viewing execution statistics for IO and TIME help measure the improvement you make with code changes.
They could be enabled with the following T-SQL:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
-- -- Enable IO and TIME execution statistics for a query -- SET STATISTICS IO ON SET STATISTICS TIME ON GO -- Run some query SELECT * FROM sys.objects GO -- disable them SET STATISTICS IO OFF SET STATISTICS TIME OFF GO |
Result:
Hope this helps,
_Sqltimes
0 Comments