May 2019
Intermediate to advanced
484 pages
11h 23m
English
In the previous section, Plans with warnings, we looked at an XQuery that will find plans that have conversion warnings at the plan level. If we want to find query execution plans that have implicit conversions anywhere in the plan, whether or not they generate a PlanAffectingConvert warning, we can use an XQuery that looks specifically for implicit conversions.
The following query will find query execution plans that have implicit conversions in any of the operators within the plan:
WITH XMLNAMESPACES(DEFAULT'http://schemas.microsoft.com/sqlserver/2004/07/showplan'), Convertsearch AS (SELECT qp.query_plan, cp.usecounts, cp.objtype, cp.plan_handle, cs.query('.') AS StmtSimple FROM sys.dm_exec_cached_plans ...Read now
Unlock full access