Databases Reference
In-Depth Information
This provided the output shown in Figure 5-6.
FIGURE 5-6
You can also include SET statements with your query to enable several options that provide
additional output displaying the query plan for you. These options are SHOWPLAN _ TEXT and
SHOWPLAN _ ALL . The following code example demonstrates how to use these options:
Use AdventureWorks2012
go
set showplan_text on
go
select * from person.person
go
set showplan_text off
go
Following are the two result sets returned by this query. Note that this is the output after setting the
query result options to results to text , rather than results to grid:
StmtText
select * from person.person
(1 row(s) affected)
StmtText
|--Clustered Index Scan(OBJECT:([AdventureWorks2012].[Person].[Person]
.[PK_Person_BusinessEntityID]))
(1 row(s) affected)
Use AdventureWorks2012
go
set showplan_all on
go
select * from person.person
go
Search WWH ::




Custom Search