Skip to content

Latest commit

 

History

History
82 lines (58 loc) · 4.13 KB

File metadata and controls

82 lines (58 loc) · 4.13 KB
title sys.dm_exec_cached_plan_dependent_objects (Transact-SQL)
description sys.dm_exec_cached_plan_dependent_objects returns a row for each execution plan, common language runtime (CLR) execution plan, and cursor associated with a plan.
author rwestMSFT
ms.author randolphwest
ms.date 02/24/2023
ms.service sql
ms.subservice system-objects
ms.topic reference
ms.custom
ignite-2025
f1_keywords
sys.dm_exec_cached_plan_dependent_objects
dm_exec_cached_plan_dependent_objects_TSQL
sys.dm_exec_cached_plan_dependent_objects_TSQL
dm_exec_cached_plan_dependent_objects
helpviewer_keywords
sys.dm_exec_cached_plan_dependent_objects dynamic management function
dev_langs
TSQL
monikerRange =azuresqldb-current || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =fabric-sqldb

sys.dm_exec_cached_plan_dependent_objects (Transact-SQL)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance FabricSQLDB]

Returns a row for each [!INCLUDEtsql] execution plan, common language runtime (CLR) execution plan, and cursor associated with a plan.

Syntax

sys.dm_exec_cached_plan_dependent_objects(plan_handle)  

Arguments

plan_handle

Is a token that uniquely identifies a query execution plan for a batch that has executed and its plan resides in the plan cache. plan_handle is varbinary(64).

The plan_handle can be obtained from the following dynamic management objects:

Table Returned

Column name Data type Description
usecounts int Number of times the execution context or cursor has been used.

Column is not nullable.
memory_object_address varbinary(8) Memory address of the execution context or cursor.

Column is not nullable.
cacheobjtype nvarchar(50) The Plan cache object type. Column is not nullable. Possible values are:

Executable plan

CLR compiled function

CLR compiled procedure

Cursor

Permissions

Requires VIEW SERVER STATE permission on the server.

Permissions for SQL Server 2022 and later

Requires VIEW SERVER PERFORMANCE STATE permission on the server.

Physical joins

:::image type="content" source="../../relational-databases/system-dynamic-management-views/media/join-dm-exec-cached-plan-dependent-objects.svg" alt-text="Diagram of physical joins for sys.dm_exec_cached_plan_dependent_objects.":::

Relationship cardinalities

From To On Relationship
dm_exec_cached_plan_dependent_objects dm_os_memory_objects memory_object_address One-to-one

Next steps

Execution Related Dynamic Management Views and Functions (Transact-SQL)
Dynamic Management Views and Functions (Transact-SQL)
sys.syscacheobjects (Transact-SQL)