Skip to content

Latest commit

 

History

History
65 lines (44 loc) · 2.81 KB

drop-workload-group.md

File metadata and controls

65 lines (44 loc) · 2.81 KB
author ms.author ms.reviewer ms.date ms.service ms.topic
rwestMSFT
randolphwest
dfurman
02/17/2025
sql
include

Drops an existing user-defined resource governor workload group.

Note

To modify resource governor configuration in [!INCLUDEssazuremi-md.md], you must be in the context of the master database on the primary replica.

:::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

The name of an existing user-defined workload group.

Remarks

The DROP WORKLOAD GROUP statement is not allowed on the resource governor built-in internal and default groups.

If a workload group contains active sessions, deleting the workload group fails when the ALTER RESOURCE GOVERNOR RECONFIGURE statement is executed to apply the change. To avoid this problem, you can take one of the following actions:

  • Wait until all sessions in the affected group disconnect, and then execute the ALTER RESOURCE GOVERNOR RECONFIGURE statement.
  • Explicitly stop sessions in the affected group by using the KILL T-SQL command, and then execute the ALTER RESOURCE GOVERNOR RECONFIGURE statement. If you decide that you don't want to explicitly stop sessions, re-create the group by using the original name and settings.
  • Restart the server. When the server restarts, the deleted group is deleted permanently.

For more information, see Resource governor and Resource governor workload group.

Permissions

Requires the CONTROL SERVER permission.

Examples

The following example drops the workload group named adhoc.

DROP WORKLOAD GROUP adhoc;

ALTER RESOURCE GOVERNOR RECONFIGURE;

Related content