sensitivity_labels
Creates, updates, deletes, gets or lists a sensitivity_labels
resource.
Overview
Name | sensitivity_labels |
Type | Resource |
Id | azure.sql.sensitivity_labels |
Fields
- vw_sensitivity_labels
- sensitivity_labels
Name | Datatype | Description |
---|---|---|
columnName | text | field from the properties object |
column_name | text | field from the properties object |
databaseName | text | field from the properties object |
information_type | text | field from the properties object |
information_type_id | text | field from the properties object |
is_disabled | text | field from the properties object |
label_id | text | field from the properties object |
label_name | text | field from the properties object |
managed_by | text | field from the properties object |
rank | text | field from the properties object |
resourceGroupName | text | field from the properties object |
schemaName | text | field from the properties object |
schema_name | text | field from the properties object |
sensitivityLabelSource | text | field from the properties object |
serverName | text | field from the properties object |
subscriptionId | text | field from the properties object |
tableName | text | field from the properties object |
table_name | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
managedBy | string | Resource that manages the sensitivity label. |
properties | object | Properties of a sensitivity label. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | columnName, databaseName, resourceGroupName, schemaName, sensitivityLabelSource, serverName, subscriptionId, tableName | Gets the sensitivity label of a given column |
create_or_update | INSERT | columnName, databaseName, resourceGroupName, schemaName, sensitivityLabelSource, serverName, subscriptionId, tableName | Creates or updates the sensitivity label of a given column |
delete | DELETE | columnName, databaseName, resourceGroupName, schemaName, sensitivityLabelSource, serverName, subscriptionId, tableName | Deletes the sensitivity label of a given column |
update | UPDATE | databaseName, resourceGroupName, serverName, subscriptionId | Update sensitivity labels of a given database using an operations batch. |
disable_recommendation | EXEC | columnName, databaseName, resourceGroupName, schemaName, sensitivityLabelSource, serverName, subscriptionId, tableName | Disables sensitivity recommendations on a given column |
enable_recommendation | EXEC | columnName, databaseName, resourceGroupName, schemaName, sensitivityLabelSource, serverName, subscriptionId, tableName | Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns) |
SELECT
examples
Gets the sensitivity label of a given column
- vw_sensitivity_labels
- sensitivity_labels
SELECT
columnName,
column_name,
databaseName,
information_type,
information_type_id,
is_disabled,
label_id,
label_name,
managed_by,
rank,
resourceGroupName,
schemaName,
schema_name,
sensitivityLabelSource,
serverName,
subscriptionId,
tableName,
table_name
FROM azure.sql.vw_sensitivity_labels
WHERE columnName = '{{ columnName }}'
AND databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND schemaName = '{{ schemaName }}'
AND sensitivityLabelSource = '{{ sensitivityLabelSource }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND tableName = '{{ tableName }}';
SELECT
managedBy,
properties
FROM azure.sql.sensitivity_labels
WHERE columnName = '{{ columnName }}'
AND databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND schemaName = '{{ schemaName }}'
AND sensitivityLabelSource = '{{ sensitivityLabelSource }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND tableName = '{{ tableName }}';
INSERT
example
Use the following StackQL query and manifest file to create a new sensitivity_labels
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.sensitivity_labels (
columnName,
databaseName,
resourceGroupName,
schemaName,
sensitivityLabelSource,
serverName,
subscriptionId,
tableName,
properties
)
SELECT
'{{ columnName }}',
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ schemaName }}',
'{{ sensitivityLabelSource }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ tableName }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: managedBy
value: string
- name: properties
value:
- name: schemaName
value: string
- name: tableName
value: string
- name: columnName
value: string
- name: labelName
value: string
- name: labelId
value: string
- name: informationType
value: string
- name: informationTypeId
value: string
- name: isDisabled
value: boolean
- name: rank
value: string
UPDATE
example
Updates a sensitivity_labels
resource.
/*+ update */
UPDATE azure.sql.sensitivity_labels
SET
operations = '{{ operations }}'
WHERE
databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified sensitivity_labels
resource.
/*+ delete */
DELETE FROM azure.sql.sensitivity_labels
WHERE columnName = '{{ columnName }}'
AND databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND schemaName = '{{ schemaName }}'
AND sensitivityLabelSource = '{{ sensitivityLabelSource }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND tableName = '{{ tableName }}';