Sql Server, Query Optimization.
query is part of a stored procedure, you can also use system views to retrieve the execution plan information. DECLARE @xml_plan XML; SET @xml_plan = (SELECT query_plan FROM sys.dm_exec_cached_plans CROSS APPLY sys.dm_exec_sql_text(plan_handle) CROSS APPLY sys.dm_exec_text_query_plan(plan_handle,