ALTER VIEW ... COLUMN clause
Applies to: Databricks SQL 2026.47 and above
Databricks Runtime 19 and above
Unity Catalog only
Adds, updates, or removes tags on a column of a persisted Unity Catalog view. The command changes the view column's tag assignments. It does not change the view query, its data, or tags on underlying tables. These operations are equivalent to running the same tag operations with ALTER TABLE on the view.
Required permissions
You must own the view or have the APPLY TAG privilege on the view. You also need USE CATALOG on its catalog and USE SCHEMA on its schema.
Governed-tag permissions and allowed-value constraints also apply. View ownership does not bypass governed-tag authorization. Assigning a governed tag requires ASSIGN on that tag. See Manage permissions on governed tags.
Syntax
ALTER VIEW view_name
ALTER COLUMN clause
ALTER COLUMN clause
Tag operations affect one top-level view column and cannot be combined with other column changes. Use separate statements for different columns. The COLUMN keyword is required, and CHANGE is not supported in place of ALTER.
Syntax
ALTER COLUMN column_identifier
{ SET TAGS clause |
UNSET TAGS clause }
Parameters
-
The name of a persisted Unity Catalog view. Qualify it with the schema and catalog, or use the current schema and catalog. Temporary views, global temporary views, and views in
hive_metastoreare not supported. -
The name of the column to be altered. The column must be a top-level column in the view's stored schema. Column resolution follows the same rules as
ALTER TABLEcolumn tagging. Nested field paths are not supported. Use backticks to quote a column name when required. -
SET TAGS ( { tag_name = tag_value } [, ...] )
Applies tags to the column. Adds tag assignments or updates the value for a key assigned to the column. Other tag assignments are preserved. Running the same assignment again succeeds and changes nothing.
-
tag_name
A literal
STRING. Thetag_namemust be unique within the column. Tag keys are case-sensitive. -
tag_value
A literal
STRING.
-
-
SET TAGS ( tag_name [, ...] )
Applies tags without values. Valued and valueless forms cannot be mixed in one list.
-
UNSET TAGS ( tag_name [, ...] )
Removes tags from the column. Other assignments are preserved. Removing a key that is not assigned is a no-op, subject to the same authorization checks as
ALTER TABLE.-
tag_name
A literal
STRING. Thetag_namemust be unique within the column.
-
Tag naming rules and assignment limits apply. See Apply tags to Unity Catalog securable objects.
Examples
These examples use a Unity Catalog schema named main.analytics where you can create and tag views. Replace it with your own schema and choose an unused view name. If classification or reviewed is a governed tag in your account, its policy must allow these values.
Create an example view
> CREATE VIEW main.analytics.customer_contact
AS SELECT 'example@example.com' AS email;
Set tags on a view column
> ALTER VIEW main.analytics.customer_contact
ALTER COLUMN email SET TAGS ('classification' = 'sensitive');
Update a tag value
> ALTER VIEW main.analytics.customer_contact
ALTER COLUMN email SET TAGS ('classification' = 'confidential');
Inspect column tags
> SELECT column_name, tag_name, tag_value
FROM main.information_schema.column_tags
WHERE schema_name = 'analytics'
AND table_name = 'customer_contact'
AND column_name = 'email'
AND tag_name = 'classification';
column_name tag_name tag_value
----------- -------------- ------------
email classification confidential
Set a tag without a value
> ALTER VIEW main.analytics.customer_contact
ALTER COLUMN email SET TAGS ('reviewed');
Remove tags from a view column
> ALTER VIEW main.analytics.customer_contact
ALTER COLUMN email UNSET TAGS ('classification', 'reviewed');
Reject a missing column
> ALTER VIEW main.analytics.customer_contact
ALTER COLUMN phone SET TAGS ('classification' = 'sensitive');
Error: COLUMN_NOT_FOUND_IN_TABLE
Clean up
> DROP VIEW main.analytics.customer_contact;