Skip to content

Latest commit

 

History

History
53 lines (42 loc) · 2.26 KB

sys-dm-broker-activated-tasks-transact-sql.md

File metadata and controls

53 lines (42 loc) · 2.26 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
sys.dm_broker_activated_tasks (Transact-SQL)
sys.dm_broker_activated_tasks returns a row for each stored procedure activated by Service Broker.
rwestMSFT
randolphwest
02/24/2023
sql
system-objects
reference
sys.dm_broker_activated_tasks
sys.dm_broker_activated_tasks_TSQL
dm_broker_activated_tasks
dm_broker_activated_tasks_TSQL
sys.dm_broker_activated_tasks dynamic management view
TSQL

sys.dm_broker_activated_tasks (Transact-SQL)

[!INCLUDE SQL Server]

Returns a row for each stored procedure activated by Service Broker.

Column name Data type Description
spid int ID of the session of the activated stored procedure. NULLABLE.
database_id smallint ID of the database in which the queue is defined. NULLABLE.
queue_id int ID of the object of the queue for which the stored procedure was activated. NULLABLE.
procedure_name nvarchar(650) Name of the activated stored procedure. NULLABLE.
execute_as int ID of the user that the stored procedure runs as. NULLABLE.

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-broker-activated-tasks-1.svg" alt-text="Diagram of physical joins for sys.dm_broker_activated_tasks.":::

Relationship cardinalities

From To Relationship
dm_broker_activated_tasks.spid dm_exec_sessions.session_id One-to-one

Next steps

Dynamic Management Views and Functions (Transact-SQL)
Service Broker Related Dynamic Management Views (Transact-SQL)