Skip to main content

sql_server_databases

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

Overview

Namesql_server_databases
TypeResource
Idazure.azure_arc_data.sql_server_databases

Fields

NameDatatypeDescription
backup_informationtextfield from the properties object
backup_policytextfield from the properties object
collation_nametextfield from the properties object
compatibility_leveltextfield from the properties object
create_modetextfield from the properties object
databaseNametextfield from the properties object
database_creation_datetextfield from the properties object
database_optionstextfield from the properties object
earliest_restore_datetextfield from the properties object
is_read_onlytextfield from the properties object
last_database_upload_timetextfield from the properties object
locationtextThe geo-location where the resource lives
provisioning_statetextfield from the properties object
recovery_modetextfield from the properties object
resourceGroupNametextfield from the properties object
restore_point_in_timetextfield from the properties object
size_mbtextfield from the properties object
source_database_idtextfield from the properties object
space_available_mbtextfield from the properties object
sqlServerInstanceNametextfield from the properties object
statetextfield from the properties object
subscriptionIdtextfield from the properties object
tagstextResource tags.

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatabaseName, resourceGroupName, sqlServerInstanceName, subscriptionIdRetrieves an Arc Sql Server database.
listSELECTresourceGroupName, sqlServerInstanceName, subscriptionId
createINSERTdatabaseName, resourceGroupName, sqlServerInstanceName, subscriptionId, data__propertiesCreates or replaces an Arc Sql Server Database.
deleteDELETEdatabaseName, resourceGroupName, sqlServerInstanceName, subscriptionIdDeletes an Arc Sql Server database resource.
updateUPDATEdatabaseName, resourceGroupName, sqlServerInstanceName, subscriptionIdUpdates an existing database.

SELECT examples

SELECT
backup_information,
backup_policy,
collation_name,
compatibility_level,
create_mode,
databaseName,
database_creation_date,
database_options,
earliest_restore_date,
is_read_only,
last_database_upload_time,
location,
provisioning_state,
recovery_mode,
resourceGroupName,
restore_point_in_time,
size_mb,
source_database_id,
space_available_mb,
sqlServerInstanceName,
state,
subscriptionId,
tags
FROM azure.azure_arc_data.vw_sql_server_databases
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND sqlServerInstanceName = '{{ sqlServerInstanceName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

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

/*+ create */
INSERT INTO azure.azure_arc_data.sql_server_databases (
databaseName,
resourceGroupName,
sqlServerInstanceName,
subscriptionId,
data__properties,
tags,
location,
properties
)
SELECT
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ sqlServerInstanceName }}',
'{{ subscriptionId }}',
'{{ data__properties }}',
'{{ tags }}',
'{{ location }}',
'{{ properties }}'
;

UPDATE example

Updates a sql_server_databases resource.

/*+ update */
UPDATE azure.azure_arc_data.sql_server_databases
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND sqlServerInstanceName = '{{ sqlServerInstanceName }}'
AND subscriptionId = '{{ subscriptionId }}';

DELETE example

Deletes the specified sql_server_databases resource.

/*+ delete */
DELETE FROM azure.azure_arc_data.sql_server_databases
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND sqlServerInstanceName = '{{ sqlServerInstanceName }}'
AND subscriptionId = '{{ subscriptionId }}';