Skip to content

Latest commit

 

History

History
51 lines (43 loc) · 2.83 KB

File metadata and controls

51 lines (43 loc) · 2.83 KB
title sys.dm_clr_tasks (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 06/10/2016
ms.prod sql
ms.prod_service database-engine, sql-database
ms.reviewer
ms.technology system-objects
ms.topic language-reference
f1_keywords
sys.dm_clr_tasks
sys.dm_clr_tasks_TSQL
dm_clr_tasks
dm_clr_tasks_TSQL
dev_langs
TSQL
helpviewer_keywords
sys.dm_clr_tasks dynamic management view
ms.assetid 462b9061-09fa-4858-9707-03d6cc19c769
author stevestein
ms.author sstein
manager craigg
monikerRange =azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current

sys.dm_clr_tasks (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-asdb-xxxx-xxx-md]

Returns a row for all common language runtime (CLR) tasks that are currently running. A [!INCLUDEtsql] batch that contains a reference to a CLR routine creates a separate task for execution of all the managed code in that batch. Multiple statements in the batch that require managed code execution use the same CLR task. The CLR task is responsible for maintaining objects and state pertaining to managed code execution, as well as the transitions between the instance of [!INCLUDEssNoVersion] and the common language runtime.

Column name Data type Description
task_address varbinary(8) Address of the CLR task.
sos_task_address varbinary(8) Address of the underlying [!INCLUDEtsql] batch task.
appdomain_address varbinary(8) Address of the application domain in which this task is running.
state nvarchar(128) Current state of the task.
abort_state nvarchar(128) State the abort is currently in (if the task was canceled) There are multiple states involved while aborting tasks.
type nvarchar(128) Task type.
affinity_count int Affinity of the task.
forced_yield_count int Number of times the task was forced to yield.

Permissions

On [!INCLUDEssNoVersion_md], requires VIEW SERVER STATE permission.
On [!INCLUDEssSDS_md], requires the VIEW DATABASE STATE permission in the database.

See Also

Dynamic Management Views and Functions (Transact-SQL)
Common Language Runtime Related Dynamic Management Views (Transact-SQL)