Skip to main content

job_target_groups

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

Overview

Namejob_target_groups
TypeResource
Idazure.sql.job_target_groups

Fields

NameDatatypeDescription
jobAgentNametextfield from the properties object
memberstextfield from the properties object
resourceGroupNametextfield from the properties object
serverNametextfield from the properties object
subscriptionIdtextfield from the properties object
targetGroupNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTjobAgentName, resourceGroupName, serverName, subscriptionId, targetGroupNameGets a target group.
list_by_agentSELECTjobAgentName, resourceGroupName, serverName, subscriptionIdGets all target groups in an agent.
create_or_updateINSERTjobAgentName, resourceGroupName, serverName, subscriptionId, targetGroupNameCreates or updates a target group.
deleteDELETEjobAgentName, resourceGroupName, serverName, subscriptionId, targetGroupNameDeletes a target group.

SELECT examples

Gets all target groups in an agent.

SELECT
jobAgentName,
members,
resourceGroupName,
serverName,
subscriptionId,
targetGroupName
FROM azure.sql.vw_job_target_groups
WHERE jobAgentName = '{{ jobAgentName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.sql.job_target_groups (
jobAgentName,
resourceGroupName,
serverName,
subscriptionId,
targetGroupName,
properties
)
SELECT
'{{ jobAgentName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ targetGroupName }}',
'{{ properties }}'
;

DELETE example

Deletes the specified job_target_groups resource.

/*+ delete */
DELETE FROM azure.sql.job_target_groups
WHERE jobAgentName = '{{ jobAgentName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND targetGroupName = '{{ targetGroupName }}';