| author | rwestMSFT |
|---|---|
| ms.author | randolphwest |
| ms.reviewer | dfurman |
| ms.date | 02/17/2025 |
| ms.service | sql |
| ms.topic | 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.
DROP WORKLOAD GROUP group_name
[;]
The name of an existing user-defined workload group.
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 RECONFIGUREstatement. - Explicitly stop sessions in the affected group by using the KILL T-SQL command, and then execute the
ALTER RESOURCE GOVERNOR RECONFIGUREstatement. 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.
Requires the CONTROL SERVER permission.
The following example drops the workload group named adhoc.
DROP WORKLOAD GROUP adhoc;
ALTER RESOURCE GOVERNOR RECONFIGURE;