Skip to content

Instantly share code, notes, and snippets.

@vvgsrk
Last active July 10, 2024 18:15
Show Gist options
  • Save vvgsrk/10f74f68490a84ea7fe90d906a2ac3bd to your computer and use it in GitHub Desktop.
Save vvgsrk/10f74f68490a84ea7fe90d906a2ac3bd to your computer and use it in GitHub Desktop.
SELECT 'ALTER TABLE IF EXISTS ' || LOWER(table_catalog) || '.' || LOWER(table_schema) || '.' || LOWER(table_name) || ' MODIFY COLUMN ' || LOWER(column_name) || ' SET TAG ' || ' dp_governance.tags.customer_sensitive = ''add_source_name'';' AS set_statement,
'ALTER TABLE IF EXISTS ' || LOWER(table_catalog) || '.' || LOWER(table_schema) || '.' || LOWER(table_name) || ' MODIFY COLUMN ' || LOWER(column_name) || ' UNSET TAG ' || ' dp_governance.tags.customer_sensitive;' AS unset_statement
FROM dp_dev.information_schema.columns
WHERE table_name = 'TABLE_NAME_X'
AND column_name IN ('COLUMN_NAME_1', 'COLUMN_NAME_2', 'COLUMN_NAME_3')
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment