Skip to Main Content
Learn T-SQL Querying
book

Learn T-SQL Querying

by Pedro Lopes, Pam Lahoud
May 2019
Intermediate to advanced content levelIntermediate to advanced
484 pages
11h 23m
English
Packt Publishing
Content preview from Learn T-SQL Querying

The sys.dm_exec_query_statistics_xml DMF

SQL Server 2016 SP1 introduced a new DMF named sys.dm_exec_query_statistics_xml, which leverages LWP by default, but it also works if Standard Profiling is enabled. This DMF outputs the query execution plan as a snapshot of the current in-flight request. As such, this query execution plan will have transient runtime statistics captured at the moment the DMF was invoked.

The ability to programmatically access the query execution plan for any running request is a leap forward for scenarios in which we must troubleshoot a long-running query. In this case, we can use this DMF, or LQS, which we discussed in the first section of this chapter.

Let's look at a practical example of using this new DMF. The following ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn T-SQL Querying - Second Edition

Learn T-SQL Querying - Second Edition

Pedro Lopes, Pam Lahoud
SQL Server T-SQL Recipes, Fourth Edition

SQL Server T-SQL Recipes, Fourth Edition

Jason Brimhall, Jonathan Gennick, Wayne Sheffield

Publisher Resources

ISBN: 9781789348811Supplemental Content