ALTER EXTERNAL CONSUMER … MODIFY PROGRAMMATIC ACCESS TOKEN (PAT)¶
Modifies the properties of a Programmatic Access Token (PAT) for an external consumer.
Syntax¶
Required parameters¶
nameSpecifies the identifier for the external consumer.
MODIFY { PROGRAMMATIC ACCESS TOKEN | PAT } token_nameModifies the programmatic access token with the specified name.
PATis an alias forPROGRAMMATIC ACCESS TOKEN.
Optional parameters¶
IF EXISTSApplies the change only if a token with the specified name exists. If no token with that name exists, the command does nothing and completes successfully instead of returning an error.
DAYS_TO_EXPIRY = integerUpdates the number of days that the token can be used for authentication.
COMMENT = 'string_literal'Updates the comment on the token.
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
| Privilege | Object | Notes |
|---|---|---|
| OWNERSHIP | External Consumer | Required to modify a PAT for the external consumer. |
For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.
For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.
Examples¶
Update the comment on a PAT:
Update the expiry on a PAT: