by Joe Havelick
5. February 2008 12:36
While troubleshooting SQL scripts that run inconsistently, it is often helpful to understand the time it takes to compile a query plan, assess the it, and understand how many index seeks and/or scans are required to complete it. The following code encapsulating your query will allow you to do so.
SET STATISTICS IO ON
SET STATISTICS TIME ON
SET STATISTICS PROFILE ON
--SQL Statement
SET STATISTICS IO OFF
SET STATISTICS TIME OFF
SET STATISTICS PROFILE OFF
b6ac4bf4-da6e-40aa-8bf7-f09b4d9cc2f7|2|5.0|27604f05-86ad-47ef-9e05-950bb762570c
Tags: sql
Tech Tips