Skip to main content

maintenance_windows

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

Overview

Namemaintenance_windows
TypeResource
Idazure.sql.maintenance_windows

Fields

NameDatatypeDescription
databaseNametextfield from the properties object
maintenanceWindowNametextfield from the properties object
resourceGroupNametextfield from the properties object
serverNametextfield from the properties object
subscriptionIdtextfield from the properties object
time_rangestextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatabaseName, maintenanceWindowName, resourceGroupName, serverName, subscriptionIdGets maintenance windows settings for a database.
create_or_updateINSERTdatabaseName, maintenanceWindowName, resourceGroupName, serverName, subscriptionIdSets maintenance windows settings for a database.

SELECT examples

Gets maintenance windows settings for a database.

SELECT
databaseName,
maintenanceWindowName,
resourceGroupName,
serverName,
subscriptionId,
time_ranges
FROM azure.sql.vw_maintenance_windows
WHERE databaseName = '{{ databaseName }}'
AND maintenanceWindowName = '{{ maintenanceWindowName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

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