Skip to main content

sql_servers

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

Overview

Namesql_servers
TypeResource
Idazure.azure_data.sql_servers

Fields

NameDatatypeDescription
corestextfield from the properties object
editiontextfield from the properties object
property_bagtextfield from the properties object
registration_idtextfield from the properties object
resourceGroupNametextfield from the properties object
sqlServerNametextfield from the properties object
sqlServerRegistrationNametextfield from the properties object
subscriptionIdtextfield from the properties object
versiontextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTresourceGroupName, sqlServerName, sqlServerRegistrationName, subscriptionIdGets a SQL Server.
list_by_resource_groupSELECTresourceGroupName, sqlServerRegistrationName, subscriptionIdGets all SQL Servers in a SQL Server Registration.
create_or_updateINSERTresourceGroupName, sqlServerName, sqlServerRegistrationName, subscriptionIdCreates or updates a SQL Server.
deleteDELETEresourceGroupName, sqlServerName, sqlServerRegistrationName, subscriptionIdDeletes a SQL Server.

SELECT examples

Gets all SQL Servers in a SQL Server Registration.

SELECT
cores,
edition,
property_bag,
registration_id,
resourceGroupName,
sqlServerName,
sqlServerRegistrationName,
subscriptionId,
version
FROM azure.azure_data.vw_sql_servers
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND sqlServerRegistrationName = '{{ sqlServerRegistrationName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.azure_data.sql_servers (
resourceGroupName,
sqlServerName,
sqlServerRegistrationName,
subscriptionId,
properties
)
SELECT
'{{ resourceGroupName }}',
'{{ sqlServerName }}',
'{{ sqlServerRegistrationName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;

DELETE example

Deletes the specified sql_servers resource.

/*+ delete */
DELETE FROM azure.azure_data.sql_servers
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND sqlServerName = '{{ sqlServerName }}'
AND sqlServerRegistrationName = '{{ sqlServerRegistrationName }}'
AND subscriptionId = '{{ subscriptionId }}';