Start of change

ALTER PERMISSION

The ALTER PERMISSION statement alters a row permission that exists at the current server.

Invocation

This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared.

Authorization

The authorization ID of the statement must have security administrator authority. See Administrative authority.

Syntax

Read syntax diagramSkip visual syntax diagramALTER PERMISSIONpermission-name ENABLEDISABLEREGENERATE

Description

permission-name
Identifies the row permission to be altered. It must identify a row permission that exists at the current server. It cannot be a default permission.
ENABLE, DISABLE, or REGENERATE
ENABLE
Specifies that the row permission is to be enabled for row access control. If row access control is not currently activated for the table, the row permission will become effective when row access control is activated for the table. If row access control is currently activated for the table, the row permission becomes effective immediately.
A row permission that gets an error when trying to be enabled cannot be enabled until any errors in the permission definition are resolved. This may require the row permission to be dropped and recreated with a modified definition.
ENABLE is ignored if the row permission is already defined as enabled for row access control.
DISABLE
Specifies that the row permission is to be disabled for row access control. If row access control is not currently activated for the table, the row permission will remain ineffective when row access control is activated for the table. If row access control is currently activated for the table, the row permission becomes ineffective.
If row access control is currently activated for the table and all row permissions are disabled, a default row permission that allows no access to any row of the table will be used.
DISABLE is ignored if the row permission is already defined as disabled for row access control.
REGENERATE
Specifies that the row permission is to be regenerated. The row permission definition in the catalog is used and existing dependencies and authorizations, if any, are retained. The row permission definition is reevaluated as if the row permission were being created. The user-defined functions that are referenced in the row permission must be resolved to the same secure UDFs as were resolved during the row permission creation.

Examples

Example 1: Enable permission P1.

ALTER PERMISSION P1 ENABLE 

Example 2: Disable permission P1.

ALTER PERMISSION P1 DISABLE 

Example 3: Regenerate permission P1.

ALTER PERMISSION P1 REGENERATE 
End of change