sql_server_databases
Creates, updates, deletes, gets or lists a sql_server_databases
resource.
Overview
Name | sql_server_databases |
Type | Resource |
Id | azure.azure_arc_data.sql_server_databases |
Fields
- vw_sql_server_databases
- sql_server_databases
Name | Datatype | Description |
---|---|---|
backup_information | text | field from the properties object |
backup_policy | text | field from the properties object |
collation_name | text | field from the properties object |
compatibility_level | text | field from the properties object |
create_mode | text | field from the properties object |
databaseName | text | field from the properties object |
database_creation_date | text | field from the properties object |
database_options | text | field from the properties object |
earliest_restore_date | text | field from the properties object |
is_read_only | text | field from the properties object |
last_database_upload_time | text | field from the properties object |
location | text | The geo-location where the resource lives |
provisioning_state | text | field from the properties object |
recovery_mode | text | field from the properties object |
resourceGroupName | text | field from the properties object |
restore_point_in_time | text | field from the properties object |
size_mb | text | field from the properties object |
source_database_id | text | field from the properties object |
space_available_mb | text | field from the properties object |
sqlServerInstanceName | text | field from the properties object |
state | text | field from the properties object |
subscriptionId | text | field from the properties object |
tags | text | Resource tags. |
Name | Datatype | Description |
---|---|---|
location | string | The geo-location where the resource lives |
properties | object | The properties of Arc Sql Server database resource |
tags | object | Resource tags. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | databaseName, resourceGroupName, sqlServerInstanceName, subscriptionId | Retrieves an Arc Sql Server database. |
list | SELECT | resourceGroupName, sqlServerInstanceName, subscriptionId | |
create | INSERT | databaseName, resourceGroupName, sqlServerInstanceName, subscriptionId, data__properties | Creates or replaces an Arc Sql Server Database. |
delete | DELETE | databaseName, resourceGroupName, sqlServerInstanceName, subscriptionId | Deletes an Arc Sql Server database resource. |
update | UPDATE | databaseName, resourceGroupName, sqlServerInstanceName, subscriptionId | Updates an existing database. |
SELECT
examples
- vw_sql_server_databases
- sql_server_databases
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 }}';
SELECT
location,
properties,
tags
FROM azure.azure_arc_data.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.
- All Properties
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: tags
value: object
- name: location
value: string
- name: properties
value:
- name: collationName
value: string
- name: databaseCreationDate
value: string
- name: compatibilityLevel
value: integer
- name: sizeMB
value: number
- name: spaceAvailableMB
value: number
- name: state
value: string
- name: isReadOnly
value: boolean
- name: recoveryMode
value: string
- name: databaseOptions
value:
- name: isAutoCloseOn
value: boolean
- name: isAutoShrinkOn
value: boolean
- name: isAutoCreateStatsOn
value: boolean
- name: isAutoUpdateStatsOn
value: boolean
- name: isRemoteDataArchiveEnabled
value: boolean
- name: isMemoryOptimizationEnabled
value: boolean
- name: isEncrypted
value: boolean
- name: isTrustworthyOn
value: boolean
- name: backupInformation
value:
- name: lastFullBackup
value: string
- name: lastLogBackup
value: string
- name: backupPolicy
value:
- name: retentionPeriodDays
value: integer
- name: fullBackupDays
value: integer
- name: differentialBackupHours
value: integer
- name: transactionLogBackupMinutes
value: integer
- name: earliestRestoreDate
value: string
- name: createMode
value: string
- name: sourceDatabaseId
value: string
- name: restorePointInTime
value: string
- name: provisioningState
value: string
- name: lastDatabaseUploadTime
value: string
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 }}';