---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/alter-secret.md
  - https://ydb.tech/docs/ru/yql/reference/syntax/alter-secret.md
  - href: en/yql/reference/syntax/alter-secret.md
    type: text/markdown
    title: Markdown version
  - href: ../../../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: en/core/yql/reference/syntax/alter-secret.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# ALTER SECRET

The `ALTER SECRET` statement modifies an existing [secret](https://ydb.tech/docs/en/concepts/datamodel/secrets.md).

## Syntax {#syntax}

```sql
ALTER SECRET secret_name
WITH (option = value[, ...])
```

* `secret_name` — the name of the secret to modify.
* `option` — command option:
  * `value` — string with the secret value.

## Permissions {#permissions}

Modifying a secret requires the [right](https://ydb.tech/docs/en/yql/reference/syntax/grant.md#permissions-list) `ALTER SCHEMA`.

## Examples {#examples}

Change the value of secret `secret_name` to `secret_value_new`:

```sql
ALTER SECRET secret_name WITH (value = "secret_value_new");
```

## See also {#see-also}

* [CREATE SECRET](https://ydb.tech/docs/en/yql/reference/syntax/create-secret.md)
* [DROP SECRET](https://ydb.tech/docs/en/yql/reference/syntax/drop-secret.md)
