Skip to main content

workload_groups

Creates, updates, deletes, gets or lists a workload_groups resource.

Overview

Nameworkload_groups
TypeResource
Idazure.sql.workload_groups

Fields

NameDatatypeDescription
databaseNametextfield from the properties object
importancetextfield from the properties object
max_resource_percenttextfield from the properties object
max_resource_percent_per_requesttextfield from the properties object
min_resource_percenttextfield from the properties object
min_resource_percent_per_requesttextfield from the properties object
query_execution_timeouttextfield from the properties object
resourceGroupNametextfield from the properties object
serverNametextfield from the properties object
subscriptionIdtextfield from the properties object
workloadGroupNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatabaseName, resourceGroupName, serverName, subscriptionId, workloadGroupNameGets a workload group
list_by_databaseSELECTdatabaseName, resourceGroupName, serverName, subscriptionIdGets the list of workload groups
create_or_updateINSERTdatabaseName, resourceGroupName, serverName, subscriptionId, workloadGroupNameCreates or updates a workload group.
deleteDELETEdatabaseName, resourceGroupName, serverName, subscriptionId, workloadGroupNameDeletes a workload group.

SELECT examples

Gets the list of workload groups

SELECT
databaseName,
importance,
max_resource_percent,
max_resource_percent_per_request,
min_resource_percent,
min_resource_percent_per_request,
query_execution_timeout,
resourceGroupName,
serverName,
subscriptionId,
workloadGroupName
FROM azure.sql.vw_workload_groups
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new workload_groups resource.

/*+ create */
INSERT INTO azure.sql.workload_groups (
databaseName,
resourceGroupName,
serverName,
subscriptionId,
workloadGroupName,
properties
)
SELECT
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ workloadGroupName }}',
'{{ properties }}'
;

DELETE example

Deletes the specified workload_groups resource.

/*+ delete */
DELETE FROM azure.sql.workload_groups
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND workloadGroupName = '{{ workloadGroupName }}';