Home » Microsoft » 70-762 » Which Transact-SQL statement should you run
You have multiple queries that take a long time to complete.
You need to identify the cause by using detailed information about the Transact-SQL statements in the queries. The Transact-SQL statements must not run as part of the analysis.
Which Transact-SQL statement should you run
A. SET STATISTICS IO ON
B. SET SHOWPLAN_TEXT ON
C. SET STATISTICS XML ON
D. SET STATISTICS PROFILE ON
Correct Answer: B
Explanation/Reference:
Reference
SET SHOWPLAN_TEXT ON causes Microsoft SQL Server not to execute Transact-SQL statements. Instead, SQL Server returns detailed information about how the statements are executed.
Incorrect Answers
C SET STATISTICS XML ON causes Microsoft SQL Server to execute Transact-SQL statements and generate detailed information about how the statements were executed in the form of a well-defined XML document.
D When STATISTICS PROFILE is ON, each executed query returns its regular result set, followed by an additional result set that shows a profile of the query execution.
The additional result set contains the SHOWPLAN_ALL columns for the query and these additional columns.
Column name, Description
Rows Actual number of rows produced by each operator Executes Number of times the operator has been executed
References
httpsdocs.microsoft.comen-ussqlt-sqlstatementsset-showplan-text-transact-sql