Skip to content

Latest commit

 

History

History
127 lines (96 loc) · 4.05 KB

drop-workload-group-transact-sql.md

File metadata and controls

127 lines (96 loc) · 4.05 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs monikerRange
DROP WORKLOAD GROUP (Transact-SQL)
DROP WORKLOAD GROUP (Transact-SQL)
WilliamDAssafMSFT
wiassaf
01/02/2025
sql
t-sql
reference
DROP_WORKLOAD_GROUP_TSQL
DROP WORKLOAD GROUP
DROP WORKLOAD GROUP statement
TSQL
>=sql-server-2016 || >=sql-server-linux-2017 || =azure-sqldw-latest || =azuresqldb-mi-current

DROP WORKLOAD GROUP (Transact-SQL)

[!INCLUDE select-product]

::: moniker range=">=sql-server-2016||>=sql-server-linux-2017"

:::row::: :::column::: * SQL Server *   :::column-end::: :::column::: SQL Managed Instance :::column-end::: :::column::: Azure Synapse
Analytics
:::column-end::: :::row-end:::

 

SQL Server and SQL Managed Instance

[!INCLUDE DROP WORKLOAD GROUP]

::: moniker-end ::: moniker range="=azuresqldb-mi-current"

:::row::: :::column::: SQL Server :::column-end::: :::column::: * SQL Managed Instance *   :::column-end::: :::column::: Azure Synapse
Analytics
:::column-end::: :::row-end:::

 

SQL Server and SQL Managed Instance

[!INCLUDE DROP WORKLOAD GROUP]

::: moniker-end ::: moniker range="=azure-sqldw-latest"

:::row::: :::column::: SQL Server :::column-end::: :::column::: SQL Managed Instance :::column-end::: :::column::: * Azure Synapse
Analytics *
  :::column-end::: :::row-end:::

 

Azure Synapse Analytics

Drops a workload group. Once the statement completes, the settings are in effect.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

DROP WORKLOAD GROUP group_name  

Arguments

group_name
Is the name of an existing user-defined workload group.

Remarks

A workload group cannot be dropped if classifiers exist for the workload group. Drop the classifiers before the workload group is dropped. If there are active requests using resources from the workload group being dropped, the drop workload statement is blocked behind them.

Examples

Use the following code example to determine which classifiers need to be dropped before the workload group can be dropped.

SELECT c.name as classifier_name
      ,'DROP WORKLOAD CLASSIFIER '+c.name as drop_command
  FROM sys.workload_management_workload_classifiers c
  JOIN sys.workload_management_workload_groups g
    ON c.group_name = g.name
  WHERE g.name = 'wgXYZ' --change the filter to the workload being dropped

Permissions

Requires CONTROL DATABASE permission

Related content

::: moniker-end