Skip to content

Latest commit

 

History

History
110 lines (78 loc) · 4.04 KB

File metadata and controls

110 lines (78 loc) · 4.04 KB
title DROP WORKLOAD GROUP (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 01/10/2020
ms.prod sql
ms.prod_service sql-database
ms.reviewer
ms.technology t-sql
ms.topic language-reference
f1_keywords
DROP_WORKLOAD_GROUP_TSQL
DROP WORKLOAD GROUP
dev_langs
TSQL
helpviewer_keywords
DROP WORKLOAD GROUP statement
author CarlRabeler
ms.author carlrab
monikerRange >=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azure-sqldw-latest||=azuresqldb-mi-current

DROP WORKLOAD GROUP (Transact-SQL)

Click a product!

In the following row, click whichever product name you're interested in. The click displays different content here on this webpage, appropriate for whichever product you click.

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

* SQL Server *   SQL Database
managed instance
Azure Synapse
Analytics

 

SQL Server and SQL Database managed instance

[!INCLUDE DROP WORKLOAD GROUP]

::: moniker-end ::: moniker range="=azuresqldb-mi-current||=sqlallproducts-allversions"

SQL Server * SQL Database
managed instance *
 
Azure Synapse
Analytics

 

SQL Server and SQL Database managed instance

[!INCLUDE DROP WORKLOAD GROUP]

::: moniker-end ::: moniker range="=azure-sqldw-latest||=sqlallproducts-allversions"

SQL Server SQL Database
managed instance
* Azure Synapse
Analytics *
 

 

Azure Synapse Analytics

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

Topic link icon 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

See also

::: moniker-end