.alter table policy restricted_view_access command

Turn on or turn off the optional table restricted view access policy. When this policy is turned on for a table, data in the table can only be queried by principals who have an UnrestrictedViewer role in the database.

Permissions

You must have at least Table Admin permissions to run this command.

Syntax

Use the following syntax to turn on or turn off the policy for one table.

.alter table TableName policy restricted_view_access true|false

Use the following syntax to turn on or turn off the policy for several tables.

.alter tables (TableName,TableName2 [,...]) policy restricted_view_access true|false

Learn more about syntax conventions.

Parameters

Name Type Required Description
TableName string ✔️ The name of the table(s) to alter.

Examples

Turn on a policy for a table

.alter table MyTable policy restricted_view_access true

Turn off the policy of several tables

.alter tables (Table1, Table2, Table4) policy restricted_view_access false