When we execute query select * from sys.dm_exec_query_stats it will show aggregate performance statistics of cached
query plans of SQL Server. The details including one row per query statement
within the cached plan, and the lifetime of the rows are tied to the plan
itself. Details have two column SQL Handle and Plan Handle.
sql_handle
:- It can be used to retrieve the SQL text of the
query by calling the sys.dm_exec_sql_text dynamic management function.
select
* from sys.dm_exec_sql_text(Sql_handle)
select
* from sys.dm_exec_sql_text(0x01000100B73A5B34A021E8660100000000000000)
Output:-
plan_handle
: - This value can be
passed to the sys.dm_exec_query_plan dynamic management function to obtain the
query plan.
Select
* from sys.dm_exec_query_plan ( plan_handle )
Select
* from sys.dm_exec_query_plan (0x0500070001C1A15CC0DE4BEA0200000001000000000000000000000000000000000000000000000000000000)
Output:-
Comments
Post a Comment
Plz dont forget to like Facebook Page..
https://www.facebook.com/pages/Sql-DBAcoin/523110684456757