Skip to main content

jobs

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

Overview

Namejobs
TypeResource
Idazure.sql.jobs

Fields

NameDatatypeDescription
descriptiontextfield from the properties object
jobAgentNametextfield from the properties object
jobNametextfield from the properties object
resourceGroupNametextfield from the properties object
scheduletextfield from the properties object
serverNametextfield from the properties object
subscriptionIdtextfield from the properties object
versiontextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTjobAgentName, jobName, resourceGroupName, serverName, subscriptionIdGets a job.
list_by_agentSELECTjobAgentName, resourceGroupName, serverName, subscriptionIdGets a list of jobs.
create_or_updateINSERTjobAgentName, jobName, resourceGroupName, serverName, subscriptionIdCreates or updates a job.
deleteDELETEjobAgentName, jobName, resourceGroupName, serverName, subscriptionIdDeletes a job.

SELECT examples

Gets a list of jobs.

SELECT
description,
jobAgentName,
jobName,
resourceGroupName,
schedule,
serverName,
subscriptionId,
version
FROM azure.sql.vw_jobs
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 jobs resource.

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

DELETE example

Deletes the specified jobs resource.

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